Conversation
hugoduraes
left a comment
There was a problem hiding this comment.
Please don't delete the following files, as they are useful:
- .editorconfig - for keeping consistency between different editors/IDEs
- .nvmrc - for the ones using NVM (me, at least), this file is useful for loading the correct version of Node
- api.apib - are the specs moving somewhere else?
| strategy: | ||
| matrix: | ||
| node-version: [12.x] | ||
| node-version: [13.x] |
There was a problem hiding this comment.
I think we should stick with an LTS version of Node.
There was a problem hiding this comment.
There are some specific features only supported on 13.x, for example async hooks, and they are really important in logging, which in this case i didn't have implemented yet.
There was a problem hiding this comment.
Async hooks are still in experimental state for both 12.x and 13.x! Don't thin we should rely on them.
There was a problem hiding this comment.
Well it was closed on nodejs/node#31945 and released upstream in 13.10.0 https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V13.md#13.10.0
Need to wait for documentation to update.
| unix_ts: { | ||
| type: DataTypes.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: 'date_part(epoch' |
There was a problem hiding this comment.
You missed the ending parenthesis
| timestamp: { | ||
| type: DataTypes.DATE, | ||
| allowNull: true, | ||
| defaultValue: 'timezone(utc' |
There was a problem hiding this comment.
You missed the ending parenthesis
| timestamp: { | ||
| type: DataTypes.DATE, | ||
| allowNull: true, | ||
| defaultValue: 'timezone(utc' |
There was a problem hiding this comment.
You missed the ending parenthesis
There was a problem hiding this comment.
This seems to be a glitch on the generator from sequelize.
| unix_ts: { | ||
| type: DataTypes.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: 'date_part(epoch' |
There was a problem hiding this comment.
You missed the ending parenthesis
There was a problem hiding this comment.
I just picked the schema from the git repo and placed it on the project
| CREATE UNIQUE INDEX IF NOT EXISTS user_status_id0 ON user_status (id); | ||
| DELETE FROM user_status; | ||
| INSERT INTO user_status(status) values('normal'); | ||
| INSERT INTO user_status(status) values('self quarentine'); |
There was a problem hiding this comment.
typo, it should be "quarantine"
| DELETE FROM user_status; | ||
| INSERT INTO user_status(status) values('normal'); | ||
| INSERT INTO user_status(status) values('self quarentine'); | ||
| INSERT INTO user_status(status) values('quarentine'); |
| "start": "node server.js", | ||
| "start:dev": "nodemon server.js" | ||
| "start": "node app.js", | ||
| "dev": "nodemon -w debug -P app.js", |
There was a problem hiding this comment.
Nodemon is missing on the dev dependencies.
Also, can you add $NODE_DEBUG_OPTION env var to the dev script:
nodemon $NODE_DEBUG_OPTION -w debug -P app.js
It's useful for debugging for the ones using JetBrains IDEs.
|
|
||
| fastify.post('/case', { schema: { body: fastify.schemas().createCase } }, async (request, reply) => { | ||
| try { | ||
| const { postalCode, geo, condition, timestamp, symptoms } = request.body |
There was a problem hiding this comment.
Is the request.body automatically validated by specifying the schema?
I took the initiative to make a major refactor to the project in order to facilitate infrastructure developments and support.
Please check the README.md