Ajay Verma
Ajay Verma

Reputation: 21

I want to store some credentials in the session at the time when server lifts in Sails

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".

Upvotes: 0

Views: 41

Answers (1)

munkee
munkee

Reputation: 769

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.

Upvotes: 0

Related Questions