Created
March 13, 2018 12:46
-
-
Save soner8/eae67923307ba382087fc43456e9fd5a to your computer and use it in GitHub Desktop.
server
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
// server.js | |
// load the things we need | |
var express = require('express'); | |
var app = express(); | |
// set the view engine to ejs | |
app.set('view engine', 'ejs'); | |
// use res.render to load up an ejs view file | |
// index page | |
app.get('/', function (req, res) { | |
res.render('pages/index'); | |
}); | |
// about page | |
app.get('/about', function (req, res) { | |
res.render('pages/about'); | |
}); | |
app.listen(3000); | |
console.log('3000 is the magic port'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment