Skip to content

Instantly share code, notes, and snippets.

@jdaviderb
Last active May 25, 2016 19:41
Show Gist options
  • Save jdaviderb/663f913067dfc4daa3301f508a8b2444 to your computer and use it in GitHub Desktop.
Save jdaviderb/663f913067dfc4daa3301f508a8b2444 to your computer and use it in GitHub Desktop.
'use strict';
const express = require('express');
const morgan = require('morgan');
const app = express();
//middlewares
const authenticationMiddleware = require('./middleware/authentication');
// resources
const usersResource = require('./resources/users');
const postsResource = require('./resources/posts');
var auth = express.Router();
auth.use(authenticationMiddleware);
auth.use('/users',usersResource);
auth.use('/posts',postsResource);
app.use(auth);
app.listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment