Working with JSON Data

0 Tushar Gupta · November 27, 2015
Hello,

I have installed and setup the express framework just like in the tutorials.

But in app.js ,when I use  :
// below var app=express();
app.locals.points="8713";

and then on the index.ejs page,
I use

<%= points %>


It is showing the error of  "points not defined" .


What is the issue??


Thanks

Post a Reply

Replies

Oldest  Newest  Rating
0 sushant kumar · March 17, 2016
It might be slightly late for this reply but did you try refreshing webstorm? in my case I dont see any changes in the browser after I have made changes to the .js and .ejs files but when I close and re-open webstorm I see all the hanges in the browser. This brings me to my own query how do you refresh webstorm without having to re-open every time you create a new file?
0 Chathula Sampath · December 10, 2015
just try this code..

app.locals = {
points = "8713"
};
  • 1

Node.js

87 followers
About

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Links
Moderators