Initial Commit
This commit is contained in:
16
routes/index.js
Normal file
16
routes/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const express = require('express')
|
||||
const pages = require('./pages')
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
pages.map(page => {
|
||||
router.get(page.location, (request, response, next) => {
|
||||
const p = page.page ? page.page : 'viz'
|
||||
response.render(p, {script : `/js/${page.file}.js`,
|
||||
style : `/css/${page.file}.css`})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
module.exports = router
|
||||
24
routes/pages.js
Normal file
24
routes/pages.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const pages = [
|
||||
{location: '/', file: 'index', page: 'index'},
|
||||
{location: '/one-circle', file: 'one-circle'},
|
||||
{location: '/one-line', file: 'one-line'},
|
||||
{location: '/one-box', file: 'one-box'},
|
||||
{location: '/confetti', file: 'confetti'},
|
||||
{location: '/stacked-circles', file: 'stacked-circles'},
|
||||
{location: '/scaled-line', file: 'scaled-line'},
|
||||
{location: '/animated-scaled-line', file: 'animated-scaled-line'},
|
||||
{location: '/basic-line-chart', file: 'basic-line-chart'},
|
||||
{location: '/area-chart', file: 'area-chart'},
|
||||
{location: '/time-chart', file: 'time-chart'},
|
||||
{location: '/planets', file: 'planets'},
|
||||
{location: '/scores', file: 'scores'},
|
||||
{location: '/peace-sign', file: 'peace-sign'},
|
||||
{location: '/montly-bills', file: 'montly-bills'},
|
||||
{location: '/flower-chart', file: 'flower-chart'},
|
||||
{location: '/updated-circle', file: 'updated-circle'},
|
||||
{location: '/updating-bar-chart', file: 'updating-bar-chart'},
|
||||
{location: '/user-updating-bar-chart', file: 'user-updating-bar-chart'},
|
||||
{location: '/updating-pie-chart', file: 'updating-pie-chart'},
|
||||
]
|
||||
|
||||
module.exports = pages
|
||||
Reference in New Issue
Block a user