Created
August 26, 2016 17:28
-
-
Save SuperManEver/c3f41624f1a41907dca481ccb8a0478c to your computer and use it in GitHub Desktop.
backend example
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
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.set('port', (process.env.PORT || 5000)); | |
app.use(express.static(__dirname + '/public')); | |
app.get('/', (req, res) => { | |
res.sendFile(path.join(__dirname, 'public', 'index.html')); | |
}); | |
app.get('/stories', (req, res) => { | |
res.sendFile(path.join(__dirname, 'public', 'index.html')); | |
}); | |
app.get('/bookmarks', (req, res) => { | |
res.sendFile(path.join(__dirname, 'public', 'index.html')); | |
}); | |
app.listen(app.get('port'), () => { | |
console.log('Example app listening on port 3000', app.get('port')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment