Socket
Book a DemoInstallSign in
Socket

mycro-express

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycro-express

express hook for mycro apps

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mycro-express

an express hook for mycro apps.

Installing

npm install --save mycro-express

Configuration

// in /config/express.js
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const methodOverride = require('method-override');

module.exports = function(mycro) {

    return function configureExpress(app, done) {
        app.use(logger('dev'));
        app.use(bodyParser.json({ limit: '500kb' }));
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(methodOverride());

        const env = process.env.NODE_ENV || 'development';
        app.set('env', env);
        if (/test/.test(env)) {
            app.set('debug', true);
        }

        const port = process.env.PORT || 8080;
        app.set('port', port);

        process.nextTick(done.bind(null, null, app));
    }
}

Testing

run tests

npm test

run coverage

npm run coverage

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

License

Copyright (c) 2016 Chris Ludden. Licensed under the MIT license.

Keywords

mycro

FAQs

Package last updated on 05 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts