File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 66 "module" : " build/server.js" ,
77 "type" : " module" ,
88 "scripts" : {
9- "dev" : " GRAPHILE_ENV=development bun run --watch src/server.ts" ,
9+ "dev" : " NODE_ENV=development GRAPHILE_ENV=development bun run --watch src/server.ts" ,
1010 "build" : " bun build --target node --outdir build src/server.ts" ,
1111 "start" : " NODE_ENV=production GRAPHILE_ENV=production bun db:migrate && NODE_ENV=production GRAPHILE_ENV=production bun run build/server.js" ,
1212 "lint" : " biome lint src" ,
2424 "graphile:generate" : " NODE_ENV=development GRAPHILE_ENV=development bun run --env-file .env.local src/scripts/generateGraphqlSchema.ts" ,
2525 "prepare" : " husky"
2626 },
27- "trustedDependencies" : [" @biomejs/biome" ],
27+ "trustedDependencies" : [
28+ " @biomejs/biome"
29+ ],
2830 "devDependencies" : {
2931 "@biomejs/biome" : " ^1.9.4" ,
3032 "@types/bun" : " ^1.2.13" ,
Original file line number Diff line number Diff line change @@ -9,23 +9,30 @@ import { useGrafast } from "grafast/envelop";
99
1010import { schema } from "generated/graphql/schema.executable" ;
1111import appConfig from "lib/config/app.config" ;
12- import { CORS_ALLOWED_ORIGINS , PORT , isProdEnv } from "lib/config/env.config" ;
12+ import {
13+ CORS_ALLOWED_ORIGINS ,
14+ PORT ,
15+ isDevEnv ,
16+ isProdEnv ,
17+ } from "lib/config/env.config" ;
1318import createGraphqlContext from "lib/graphql/createGraphqlContext" ;
1419import { armorPlugins , useAuth } from "lib/graphql/plugins" ;
1520
1621/**
1722 * Elysia server.
1823 */
1924const app = new Elysia ( {
20- serve : {
21- // https://elysiajs.com/patterns/configuration#serve-tls
22- // https://bun.sh/guides/http/tls
23- // NB: Elysia (and Bun) trust the well-known CA list curated by Mozilla (https://wiki.mozilla.org/CA/Included_Certificates), but they can be customized here if needed (`tls.ca` option)
24- tls : {
25- certFile : "cert.pem" ,
26- keyFile : "key.pem" ,
25+ ...( isDevEnv && {
26+ serve : {
27+ // https://elysiajs.com/patterns/configuration#serve-tls
28+ // https://bun.sh/guides/http/tls
29+ // NB: Elysia (and Bun) trust the well-known CA list curated by Mozilla (https://wiki.mozilla.org/CA/Included_Certificates), but they can be customized here if needed (`tls.ca` option)
30+ tls : {
31+ certFile : "cert.pem" ,
32+ keyFile : "key.pem" ,
33+ } ,
2734 } ,
28- } ,
35+ } ) ,
2936} )
3037 . use (
3138 cors ( {
You can’t perform that action at this time.
0 commit comments