Skip to content

Commit

Permalink
update express.js to serve template from root
Browse files Browse the repository at this point in the history
  • Loading branch information
martapolii committed Oct 18, 2024
1 parent ce53e5b commit b3ceee2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ import cookieParser from 'cookie-parser'
import compress from 'compression'
import cors from 'cors'
import helmet from 'helmet'
import Template from './../template.js' //import the template.js file do its served at the root URL


const app = express()

//serve template at the root URL
app.get('/', (req, res) => {
res.status(200).send(Template())
})


//configure express
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
Expand Down

0 comments on commit b3ceee2

Please # to comment.