Video 44
This commit is contained in:
parent
250110bdb8
commit
2a8bb440df
@ -1,21 +1,28 @@
|
||||
const express = require('express')
|
||||
|
||||
const app = express()
|
||||
|
||||
app.get('', (req, res) => {
|
||||
res.send('Hello express!')
|
||||
res.send('<h1>Weather</h1>')
|
||||
})
|
||||
|
||||
app.get('/help', (req, res) => {
|
||||
res.send('Help page')
|
||||
res.send([{
|
||||
name: 'Jason',
|
||||
age: 38
|
||||
}, {
|
||||
name: 'Sarah'
|
||||
}])
|
||||
})
|
||||
|
||||
app.get('/about', (req, res) => {
|
||||
res.send('About')
|
||||
res.send('<h1>About</h1>')
|
||||
})
|
||||
|
||||
app.get('/weather', (req, res) => {
|
||||
res.send('Your weather')
|
||||
res.send({
|
||||
location: 'Calgary',
|
||||
forecast: 'It\'s snowing. It\'s really gross out.'
|
||||
})
|
||||
})
|
||||
|
||||
app.listen(4200, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user