Created
March 3, 2017 20:44
-
-
Save yeti-detective/1c5c7646cfa88a39434b85d642d56ea1 to your computer and use it in GitHub Desktop.
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
const express = require('express'); // this is just so easy. Read up on it later | |
const app = express(); // now 'app' is an express application | |
const path = require('path'); // this will help you tell Node where your files are | |
// when the app 'gets' a request, it will send the index.html file | |
app.get('/', (req, res)=>{ | |
res.sendFile(path.join(__dirname + '/index.html')); | |
}); | |
// the app will listen for requests on port 3000 | |
app.listen(3000, ()=>{ | |
console.log('listening on http://localhost:3000'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment