Skip to content

Instantly share code, notes, and snippets.

@coloredlambda
Created April 3, 2018 07:39
Show Gist options
  • Save coloredlambda/997f87c7966311525722599b9a5c20b0 to your computer and use it in GitHub Desktop.
Save coloredlambda/997f87c7966311525722599b9a5c20b0 to your computer and use it in GitHub Desktop.
Simple express boilerplate
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