I am using Sails and Postgres and I want to save some credentials in the session at the start-up of server. Kindly help me. How can I do this, and is there any possibilities that it may give some error just because of database connectivity with the application. I am using connect-redis"~1.4.5".
Asked
Active
Viewed 39 times
0
-
But session starts for each user when he enters site, not when server starts. So what you want to do? – Bonanza May 04 '16 at 09:57
1 Answers
0
You do have the option of utilising the bootstrap.js file. Essentially this runs code you define during the lifting process of sails. For instance you could use this to pre-populate a test database or in your case to authenticate a "test" user and store the person within a session.
http://sailsjs.org/documentation/anatomy/my-app/config/bootstrap-js
Documentation is linked above.

munkee
- 759
- 1
- 9
- 23