Last active
May 25, 2016 19:41
-
-
Save jdaviderb/663f913067dfc4daa3301f508a8b2444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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