javascript - Load some database data in memory when Express loads -


is there simple way store data in express? example, load api keys (from postgresql database) in memory when server starts don't have query postgresql each single request api.

i thought using global.api_keys, globals should avoided (right?) i'm pretty sure there's better solution.

how that?

you can use app.set(name, value) that.

then, can setted value app.get(name).

hth

reference: http://expressjs.com/3x/api.html


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -