xonecas.io
4436
Sl

sesame-labs-coding-assignment / commit 808d937

Use keys from env and have an exit code

Sean2023-01-17 808d937017642b95863ad0df04366b3a62ae7aff parent 48c96c0

2 files changed

api/.env.sample+1−0
@@ -2,6 +2,7 @@
22 ENVIRONMENT=dev
33 PORT=3001
44 CLIENT_URL="http://localhost:3000/"
5+APP_KEYS='A very good secret'
56
67 # Discord related values:
78 DISCORD_APPLICATION_ID=000000000000000000
api/src/index.ts+2−2
@@ -15,7 +15,7 @@ async function main() {
1515 dotenv.config();
1616
1717 const app = new Koa();
18- app.keys = ["A very good secret!"];
18+ app.keys = [process.env.APP_KEYS || ""];
1919
2020 // Expose prisma client instance to context:
2121 app.context.prisma = prisma;
@@ -46,5 +46,5 @@ main()
4646 .catch(async (e) => {
4747 await prisma.$disconnect();
4848 console.error(e);
49- process.exit();
49+ process.exit(1);
5050 });