Browse Source

adding some notes in app.js

tesla
Levi Olson 4 years ago
committed by GitHub
parent
commit
358419c879
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app.js

+ 2
- 1
app.js View File

@ -18,6 +18,7 @@ app.get('/', (req, res) => {
})
})
// This is really really inefficient... this should be cached and built during a build.
app.get('/posts', (req, res) => {
const postDir = __dirname + '/posts'
let files = fs.readdirSync(postDir, 'utf8')
@ -93,4 +94,4 @@ app.get('/posts/:post', (req, res) => {
const port = 3000
app.listen(port, () => console.log('Example app listening on port ' + port + '!'))
module.exports = app
module.exports = app

Loading…
Cancel
Save