File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 4040 # - name: Lint API
4141 # run: npm run lint
4242
43+ - name : Create .env file
44+ run : |
45+ echo "MACHINE_ID=1" > .env
46+ working-directory : api # Ensure it is created inside `api/`
47+
4348 - name : Run Tests (API)
4449 run : yarn test
4550
51+ - name : Build API
52+ run : yarn build
53+
4654 # Webapp (Next.js) Build & Test
4755 webapp :
4856 name : Webapp Build & Test
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ export class ShortenUrlIdGeneratorService {
2828 private lastTimestamp : number ;
2929
3030 constructor ( private readonly configService : ConfigService ) {
31+ // check if the machine id is not null
32+ if ( ! this . configService . get < number > ( 'MACHINE_ID' ) )
33+ throw new Error ( 'MACHINE_ID is not defined in the environment variables' ) ;
34+
3135 this . machineId = Number ( this . configService . get < number > ( 'MACHINE_ID' ) ) ;
3236 if (
3337 this . machineId < 0 ||
You can’t perform that action at this time.
0 commit comments