Last active
September 25, 2017 08:22
-
-
Save jdltechworks/dca2c0bf517f4b95208a2fe37c3aab54 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import express from 'express' | |
import routes from './routes' | |
import bootstrap from './bootstrap' | |
const app = express() | |
bootstrap(app) | |
app.listen(3000, () => { | |
console.log('listening to port 3000') | |
}) |
This file contains hidden or 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
import routes from './routes' | |
import bodyParser from 'body-parser' | |
import cors from 'cors' | |
import { join } from 'path' | |
export default (app) => { | |
//app.set('views', join(__dirname, 'views')) | |
//middlewares | |
app.use(bodyParser.json({ type: 'application/*+json' })) | |
app.use(cors()) | |
//routes | |
app.use('/api',routes) | |
} |
This file contains hidden or 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
import express from 'express' | |
import { join } from 'path' | |
const route = express.Router() | |
route.post('', (req, res, next) => { | |
}) | |
export default route |
This file contains hidden or 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
import chart from './chart' | |
export default [chart] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment