Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api fastify #21

Merged
merged 7 commits into from Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions .editorconfig

This file was deleted.

25 changes: 6 additions & 19 deletions .env.local
@@ -1,23 +1,10 @@
APP_SERVER_PORT=3000
APP_SESSION_SALT=
FASTIFY_IGNORE_WATCH="node_modules .git"

# DEBUGGING PURPOUSES THIS SHOULD BE FALSE IN PRODUCTION MODE
DEV_MODE=true

# LOGGING
# Maximum value for logging files (20MB)
MAX_LOG_SIZE=20000000
LOGS_TO_CONSOLE=true
LOGS_FILENAME=trackovid-19-backend.log

# FACEBOOK
FB_APP_ID=254808762195063
FB_APP_SECRET=
FB_CALLBACK_URL=http://localhost:3000/auth/facebook/callback
PORT=3000

# DATABASE
DB_HOST=database-1.cdtprkmh9r7r.us-east-2.rds.amazonaws.com
DB_NAME=postgres
DB_USER=postgres
DB_HOST=
DB_NAME=
DB_USER=
DB_PASS=
DB_PORT=5432
DB_PORT=
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [13.x]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should stick with an LTS version of Node.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async hooks are still in experimental state for both 12.x and 13.x! Don't thin we should rely on them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


steps:
- uses: actions/checkout@v2
Expand All @@ -28,4 +28,4 @@ jobs:
- run: npm run build --if-present
# - run: npm test
env:
CI: true
CI: true
206 changes: 67 additions & 139 deletions .gitignore
@@ -1,140 +1,68 @@
# Please take extra care not to add rules that will make tracked files ignored.
# To test that, run `git ls-files -i --exclude-standard`.
# To check why a specific file is ignored, run `git check-ignore -v <filepath>`.

# === Rule for dotfiles ===
# Exclude specific dotfiles that we want to track.
!deps/**/.*
!test/fixtures/**/.*
!.clang-format
!.editorconfig
!.eslintignore
!.eslintrc.js
!.flake8
!.gitattributes
!.github
!.gitignore
!.gitkeep
!.mailmap
!.nycrc
!.travis.yml
!.eslintrc.yaml
!.cpplint

# === Rules for root dir ===
/core
/vgcore.*
/v8*.log
/perf.data
/perf.data.old
/tags
/doc/api.xml
/node
/node_g
/gon-config.json
/*.exe
/*.swp
/out
/*.txt
/*.msi
/*.wixpdb

# === Rules for artifacts of `./configure` ===
/icu_config.gypi
/config.gypi
/config.status
/config_fips.gypi

# === Rules for MSVS artifacts ===
Debug/
Release/
*.sln
*.suo
*.vcxproj*
UpgradeLog*.XML
_UpgradeReport_Files/
*.sdf
*.opensdf
*.VC.*
*.wixobj
/tools/msvs/genfiles/
/npm.wxs
/tools/msvs/msi/Release/
/tools/msvs/msi/obj/
/tools/msvs/msi/x64/
# Exclude MSVS files used for .msi file generation
!tools/msvs/msi/custom_actions.vcxproj
!tools/msvs/msi/nodemsi.sln

# === Rules for GYP artifacts ===
*-nodegyp*
/gyp-*-tool
/test/addons/??_*/
/*.mk

# === Rules for other build artifacts ===
/email.md
/deps/v8-*
/deps/icu
/deps/icu*.zip
/deps/icu*.tgz
/deps/icu-tmp
./node_modules
/android-toolchain/
# generated by gyp on Windows
/deps/openssl/openssl.props
/deps/openssl/openssl.targets
/deps/openssl/openssl.xml
# generated by gyp on android
/*.target.mk
/*.host.mk
/deps/openssl/openssl.target.mk
/deps/zlib/zlib.target.mk

# === Rules for release artifacts ===
/*.tar.*
/*.pkg
/SHASUMS*.txt*

# === Rules for `node_modules` ===
!**/node_modules/**
/node_modules
/tools/doc/node_modules
/tools/clang-format/node_modules

# === Rules for test artifacts ===
/*.tap
/*.xml
/node_trace.*.log
# coverage related
/gcovr
/build
/coverage

# === Rules for XCode artifacts ===
*.xcodeproj
*.xcworkspace
*.pbxproj

# === Rules for files in `/deps` ===
# Exclude all files in the vendored `npm`.
!/deps/npm/node_modules
# These are not needed and causes issues for distro packagers.
/deps/npm/node_modules/.bin/
# Respect V8's .gitignore
!deps/v8/**
# Ignore the libuv book and GitHub templates
/deps/uv/.github/
/deps/uv/docs/code/
/deps/uv/docs/src/guide/
# Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py
/deps/.cipd

# === Global Rules ===
# Keep last to avoid being excluded
*.pyc
__pycache__
.DS_Store
*~
.env
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Yarn lock
.yarn.lock

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# 0x
profile-*

# mac files
.DS_Store

# vim swap files
*.swp

# webstorm
.idea

# vscode
.vscode
*code-workspace

# clinic
profile*
*clinic*
*flamegraph*

# generated code
examples/typescript-server.js
test/types/index.js

#ENV
.env
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

67 changes: 67 additions & 0 deletions .serverless/cloudformation-template-create-stack.json
@@ -0,0 +1,67 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
}
}
},
"ServerlessDeploymentBucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"PolicyDocument": {
"Statement": [
{
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::",
{
"Ref": "ServerlessDeploymentBucket"
},
"/*"
]
]
}
],
"Condition": {
"Bool": {
"aws:SecureTransport": false
}
}
}
]
}
}
}
},
"Outputs": {
"ServerlessDeploymentBucketName": {
"Value": {
"Ref": "ServerlessDeploymentBucket"
}
}
}
}