A Secret Santa App
- Serve a few pages.
Write tests for status code and title string for each - Add users to database
- Create database build files
- Database queries (insert user, get user)
- Also write tests for database queries
- Link login and registration pages to database
- Add groups to database
- Display groups on groups page
- Ability to create groups
- " edit groups
- Invite people
Start both the node server and the react server:
npm run dev
- travis 'install' stage is where npm install happens - so be careful if
you override this in
.travis.yml
- To stop database connections from hanging, use pg pool's
end
method to close the connection see docs
(there are restrictions on when you can do this - maybe not more than once for a given pool?) - To be able to run
a module from the command line:
if(require.main == module) yourFunction();
- When using supertest for post requests, use the
.send
method to include form data, and.type('form')
to populate req.body with that data (you also need to be usingbody-parser
for this to work) e.g.:supertest(app) .post('/login') .type('form') .send({ email: 'my@email.com', password: 'top secret' }) .end(blah blah blah);
- When hashing passwords, use the
bcrypt
module rather than inbuiltcrypto
.bcrypt
is designed for hashing passwords and is more computationally expensive (harder to brute force), and a work factor can be provided so it can be made more expensive as computers get faster. - The jsonwebtoken module is synchronous under the hood, despite offering an async API #11