Skip to content

Instantly share code, notes, and snippets.

@soner8
Created March 13, 2018 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soner8/eae67923307ba382087fc43456e9fd5a to your computer and use it in GitHub Desktop.
Save soner8/eae67923307ba382087fc43456e9fd5a to your computer and use it in GitHub Desktop.
server
// 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