Skip to content
Advertisement

Tag: express

Express and ejs <%= to render a JSON

In my index.ejs I have this code: In my node I have However, on the page I obtain and if I write I obtain: Is there a way to pass a JSON that will be JS readable? Answer Oh that was easy, don’t use <%=, use <%- instead. For example: The first one will render in HTML, the second one

Error: Can’t set headers after they are sent to the client

I’m fairly new to Node.js and I am having some issues. I am using Node.js 4.10 and Express 2.4.3. When I try to access http://127.0.0.1:8888/auth/facebook, i’ll be redirected to http://127.0.0.1:8888/auth/facebook_callback. I then received the following error: The following is my code: May I know what is wrong with my code? Answer The res object in Express is a subclass of

Advertisement