Using serverless functions could be a solution vercel.com/docs/serverless-functio...
However you can get it working with normal html files.
1 - Create a folder in the root directory called views and put an index.html file inside of it.
views
index.html
2 - Add the code below to your index.js file
index.js
const path = require('path'); app.get('/', (req, res) => { res.sendFile(path.join(__dirname + '/views/index.html')); });
Now you can use html pages for your routes.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Using serverless functions could be a solution vercel.com/docs/serverless-functio...
However you can get it working with normal html files.
1 - Create a folder in the root directory called
views
and put anindex.html
file inside of it.2 - Add the code below to your
index.js
fileNow you can use html pages for your routes.