Created
April 3, 2018 07:39
-
-
Save coloredlambda/997f87c7966311525722599b9a5c20b0 to your computer and use it in GitHub Desktop.
Simple express boilerplate
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
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const multer = require('multer'); | |
const app = express(); | |
app.get('/api', (req, res) => { | |
res.send('Welcome to our upload server. Have a nice ride') | |
}); | |
app.post('/api/upload', (req, res) => { | |
console.log('Upload hit') | |
}); | |
app.get('*', (req, res) => { | |
res.send('Mmmm, you must be lost. We have no such route') | |
}); | |
app.listen(8080, () => { | |
console.log('Server started on http://localhost:8080') | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment