Skip to content

Commit e6dd54d

Browse files
committed
feat: add production fixtures loading command and refactor logging path
1 parent b45f48c commit e6dd54d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"test": "jest",
88
"start": "npx serverless offline",
99
"load-fixtures": "ts-node src/scripts/loadBookFixtures.ts",
10+
"load-fixtures:production": "NODE_ENV=production ts-node src/scripts/loadBookFixtures.ts",
1011
"fetch-covers": "ts-node src/scripts/fetchBookCovers.ts",
1112
"typeorm": "typeorm-ts-node-commonjs"
1213
},

src/data-source.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const requiredEnvVars = [
1111
"DB_NAME",
1212
"DB_USERNAME",
1313
"DB_PASSWORD",
14-
"DB_SSL_CERT",
1514
];
1615

1716
const envPath =

src/scripts/fetchBookCovers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import https from "https";
22
import { writeFile } from "fs/promises";
3-
import { booksData } from "../fixtures/books";
3+
import booksData from "../fixtures/booksData";
44

55
const fetchBookCover = (book) =>
66
new Promise((resolve, reject) => {

src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const logger = winston.createLogger({
1111
level: "info",
1212
format: winston.format.json(),
1313
transports: [
14-
new winston.transports.File({ filename: "logs/error.log", level: "error" }),
15-
new winston.transports.File({ filename: "logs/combined.log" }),
14+
new winston.transports.File({ filename: "/tmp/error.log", level: "error" }),
15+
new winston.transports.File({ filename: "/tmp/combined.log" }),
1616
],
1717
});
1818

0 commit comments

Comments
 (0)