visionmedia/express — Issue #901: require('json') not working in express
Author: gabipetrovay
Created: 2011-11-23 20:54:35+00:00
State: open

node.js provides the infrastructure to load json file using require.

In node.js the following works:

```var items = require('items')```

and ```items``` will contain the parsed json content of the file ```items.json```

But when doing the same in express, I get:

500 Error: Cannot find module 'items'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
at require (module.js:346:19)
at /home/gabriel/app/routes/index.js:21:15
at callbacks (/home/gabriel/.node_libraries/.npm/express/2.5.1/package/lib/router/index.js:272:11)
at param (/home/gabriel/.node_libraries/.npm/express/2.5.1/package/lib/router/index.js:246:11)
at pass (/home/gabriel/.node_libraries/.npm/express/2.5.1/package/lib/router/index.js:253:5)
at Router._dispatch (/home/gabriel/.node_libraries/.npm/express/2.5.1/package/lib/router/index.js:280:4)
at Object.handle (/home/gabriel/.node_libraries/.npm/express/2.5.1/package/lib/router/index.js:45:10)
at next (/home/gabriel/.node_libraries/.npm/connect/1.8.0/package/lib/http.js:203:15)

Is this the desired behavior? Am I getting something wrong?

Thanks!