Skip to content

Commit 9eb5c95

Browse files
committed
fix: load dotenv before all requires
1 parent 2ed85d0 commit 9eb5c95

File tree

5 files changed

+173
-14
lines changed

5 files changed

+173
-14
lines changed

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /backend
5+
schedule:
6+
interval: weekly
7+
8+
- package-ecosystem: npm
9+
directory: /frontend
10+
schedule:
11+
interval: weekly
12+
13+
- package-ecosystem: npm
14+
directory: /mobile
15+
schedule:
16+
interval: weekly
17+
18+
- package-ecosystem: github-actions
19+
directory: /
20+
schedule:
21+
interval: weekly

.github/workflows/ci.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,50 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
10+
backend:
1111
runs-on: ubuntu-latest
12-
1312
defaults:
1413
run:
1514
working-directory: backend
1615

1716
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v3
17+
- uses: actions/checkout@v3
2018

21-
- name: Setup Node.js
22-
uses: actions/setup-node@v3
19+
- uses: actions/setup-node@v3
2320
with:
2421
node-version: 18
25-
cache: 'npm'
22+
cache: npm
2623
cache-dependency-path: backend/package-lock.json
2724

2825
- name: Install dependencies
2926
run: npm ci
3027

31-
- name: Syntax Check
32-
run: node --check server.js
28+
- name: Lint
29+
run: npm run lint
30+
31+
- name: Run tests
32+
run: npm test
3333

3434
- name: Build Docker image
35-
run: docker build -t zappify-backend .
35+
run: docker build -t zappify-backend .
36+
37+
frontend:
38+
runs-on: ubuntu-latest
39+
defaults:
40+
run:
41+
working-directory: frontend
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- uses: actions/setup-node@v3
47+
with:
48+
node-version: 18
49+
cache: npm
50+
cache-dependency-path: frontend/package-lock.json
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Lint
56+
run: npm run lint

backend/server.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require('dotenv').config();
12
const express = require('express');
23
const cors = require('cors');
34
const helmet = require('helmet');
@@ -7,10 +8,6 @@ const userRoutes = require('./routes/userRoutes');
78
const productRoutes = require('./routes/productRoutes');
89
const paymentRoutes = require('./routes/paymentRoutes');
910

10-
if (process.env.NODE_ENV !== 'production') {
11-
require('dotenv').config();
12-
}
13-
1411
connectDB();
1512

1613
const app = express();

mobile/package-lock.json

Lines changed: 119 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mobile/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"expo-crypto": "~15.0.8",
2121
"expo-dev-client": "~6.0.20",
2222
"expo-status-bar": "~3.0.9",
23+
"expo-updates": "~29.0.16",
2324
"expo-web-browser": "~15.0.10",
2425
"react": "19.1.0",
2526
"react-native": "0.81.5",

0 commit comments

Comments
 (0)