How to use the bla.apiMiddleware function in bla

To help you get started, we’ve selected a few bla examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github belyanskii / bem-ide / server / app.js View on Github external
bodyParser = require('body-parser'),
    methodOverride = require('method-override'),
    routes = require('./routes'),
    path = require('path'),
    st = require('serve-static'),
    compress = require('compression'),
    app = express(),
    apiMiddleware = require('bla').apiMiddleware;

// Deps
app
    .use(st(process.cwd()))
    .use(compress())
    .use(morgan('default'))
    .use(bodyParser())
    .use('/api/:method?', apiMiddleware(__dirname + '/api/**/*.api.js'))
    .use(methodOverride());

// Routes
var router = express.Router();

router.get('/', routes.index);

app.use('/', router);

// Start
app.listen(7777, function() { console.log('Start on port 7777'); });

bla

Easy way to create your own API methods for server and client sides

MIT
Latest version published 2 months ago

Package Health Score

62 / 100
Full package analysis

Popular bla functions