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
Post a Comment