individual route and page stub
This commit is contained in:
parent
0f049f97a2
commit
12cecf4a94
3 changed files with 25 additions and 9 deletions
|
@ -15,6 +15,7 @@ npm start
|
|||
```
|
||||
|
||||
[http://localhost:3000/](http://localhost:3000/)
|
||||
[http://localhost:3000/she/her/her/hers/herself](http://localhost:3000/she/her/her/hers/herself)
|
||||
|
||||
### Testing
|
||||
|
||||
|
|
31
app.js
31
app.js
|
@ -1,14 +1,27 @@
|
|||
import express from 'express';
|
||||
import { engine } from 'express-handlebars';
|
||||
import express from 'express'
|
||||
import { engine } from 'express-handlebars'
|
||||
|
||||
const app = express();
|
||||
const app = express()
|
||||
|
||||
app.engine('handlebars', engine());
|
||||
app.set('view engine', 'handlebars');
|
||||
app.set('views', './views');
|
||||
app.engine('handlebars', engine())
|
||||
app.set('view engine', 'handlebars')
|
||||
app.set('views', './views')
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.render('home');
|
||||
});
|
||||
res.render('home')
|
||||
})
|
||||
|
||||
app.listen(3000);
|
||||
app.get('/:nominative/:accusative/:pronominal_possessive/:predicative_possessive/:reflexive', (req, res) => {
|
||||
const {
|
||||
nominative,
|
||||
accusative,
|
||||
pronominal_possessive: pronominalPossessive,
|
||||
predicative_possessive: predicativePossessive,
|
||||
reflexive,
|
||||
} = req.params
|
||||
res.render('individual', {
|
||||
nominative, accusative, pronominalPossessive, predicativePossessive, reflexive
|
||||
})
|
||||
})
|
||||
|
||||
app.listen(3000)
|
||||
|
|
2
views/individual.handlebars
Normal file
2
views/individual.handlebars
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h1>Individual</h1>
|
||||
{{nominative}}/{{accusative}}/{{pronominalPossessive}}/{{predicativePossessive}}/{{reflexive}}
|
Loading…
Add table
Reference in a new issue