Created
December 28, 2018 19:15
-
-
Save jdstaerk/09e01f4008fa1de373313a613d9fada8 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
| let loggerBuilder = require('./logger.js'); | |
| let config = require('./config.js'); | |
| let express = require('express'); | |
| let app = express(); | |
| let logger = new loggerBuilder(); | |
| app.use(express.json()); | |
| app.use(express.urlencoded({ | |
| extended: true | |
| })); | |
| app.use(express.static('dist')); | |
| app.get('/todos', (req, res) => { | |
| // TBC | |
| }); | |
| app.delete('/todo', (req, res) => { | |
| if (!req.body.id) res.sendStatus(404); | |
| // TBC | |
| }); | |
| app.post('/todo', (req, res) => { | |
| // TBC | |
| }); | |
| const server = app.listen(3000, function () { | |
| logger.log('Server is up and running!'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment