Skip to content

Instantly share code, notes, and snippets.

@bmorelli25
Created June 24, 2017 15:48
Show Gist options
  • Save bmorelli25/bc14e106e9393744c979628b8f17948e to your computer and use it in GitHub Desktop.
Save bmorelli25/bc14e106e9393744c979628b8f17948e to your computer and use it in GitHub Desktop.
weather website partial
const express = require('express');
const bodyParser = require('body-parser');
const app = express()
app.use(express.static('public'));
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'ejs')
app.get('/', function (req, res) {
res.render('index');
})
app.post('/', function (req, res) {
console.log(req.body.city);
res.render('index');
})
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment