Skip to content

Commit

Permalink
File reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpessia committed Jul 11, 2024
1 parent f922182 commit 3e4a8cf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/.env.local → api/.env.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NODE_ENV=local
NODE_ENV=dev
PORT=3000
TZ=UTC
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN npm run build

FROM node:20.12.2-bullseye AS run

ARG ENV=local
ARG ENV=dev
ENV NODE_ENV=${ENV}
ARG NODE_OPTIONS
ENV NODE_OPTIONS=${NODE_OPTIONS}
Expand Down
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"private": true,
"scripts": {
"init": "npm i -g @nestjs/[email protected] && npm install",
"start": "cross-env NODE_ENV=local nest start --watch",
"start": "cross-env NODE_ENV=dev nest start --watch",
"start:prod": "node dist/main",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"docker:build": "sudo docker build -t dados-financeiros -f Dockerfile --build-arg ENV=local .",
"docker:build": "sudo docker build -t dados-financeiros -f Dockerfile .",
"docker:run": "sudo docker run -it -p 3000:3000 --name dados-financeiros dados-financeiros:latest",
"docker:sast": "sudo docker run --rm -v \"${PWD}:/src\" returntocorp/semgrep semgrep --metrics=off --no-git-ignore --config \"/src/.semgrep.yml\" --config \"p/secrets\" --config \"p/gitleaks\" --config \"p/owasp-top-ten\" --config \"p/cwe-top-25\" --config \"p/ci\" --config \"p/security-audit\" --config \"p/javascript\" --config \"p/typescript\" --config \"p/docker\" --config \"p/nodejs\" /src # --verbose"
},
Expand Down
3 changes: 2 additions & 1 deletion api/src/scheduler/services/scheduler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export class SchedulerService {
});

setTimeout(async () => {
const preLoad = ['prod','local'].includes(process.env.NODE_ENV);
const envs: typeof process.env.NODE_ENV[] = ['prod', 'dev'];
const preLoad = envs.includes(process.env.NODE_ENV);
if (preLoad) await this.run();
}, 5000);
}
Expand Down
2 changes: 1 addition & 1 deletion api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"skipLibCheck": true,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
"noFallthroughCasesInSwitch": false,
}
}
2 changes: 1 addition & 1 deletion api/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'local' | 'dev' | 'prod';
NODE_ENV: 'dev' | 'prod';
PORT: string;
}
}
Expand Down

0 comments on commit 3e4a8cf

Please sign in to comment.