Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render ejs not working #3

Open
Jazour11 opened this issue Mar 16, 2021 · 2 comments
Open

Render ejs not working #3

Jazour11 opened this issue Mar 16, 2021 · 2 comments

Comments

@Jazour11
Copy link

Hello,

I have having a similar issue to Khushbu11-web. Everything is fully functional until I switch the store.html file to ejs. Once I do this it says cannot GET /store.html in localhost 3000. I did check, and I am using app.set('view engine','ejs'). Any help would be greatly appreciated.

@vitustockholm
Copy link

Hello,

I have having a similar issue to Khushbu11-web. Everything is fully functional until I switch the store.html file to ejs. Once I do this it says cannot GET /store.html in localhost 3000. I did check, and I am using app.set('view engine','ejs'). Any help would be greatly appreciated.

try http://localhost:3000/store

@ukicomputers
Copy link

You are needed to write this code into server.js. Sorry for my previously message. You are nedded only add this code in server.js:
app.get('/store', function(req, res) { fs.readFile('items.json', function(error, data) { if (error) { res.status(500).end() } else { res.render('store.ejs', { stripePublicKey: stripePublicKey, items: JSON.parse(data) }) } }) })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants