Created
June 24, 2017 15:48
-
-
Save bmorelli25/bc14e106e9393744c979628b8f17948e to your computer and use it in GitHub Desktop.
weather website partial
This file contains hidden or 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'); | |
| 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