mirror of
https://github.com/wassname/talk.git
synced 2026-08-13 12:40:11 +08:00
[next] Heroku Support (#2240)
* feat: added env-rewrite support * feat: added heroku support via app.json * fix: fixed readme linting error * fix: fixed error in app.json * fix: improved environment variables exposed by app.json
This commit is contained in:
@@ -59,7 +59,7 @@ const config = convict({
|
||||
env: "LOCALE",
|
||||
},
|
||||
enable_graphiql: {
|
||||
doc: "When true, this will enable the GraphiQL routes",
|
||||
doc: "When true, this will enable the GraphiQL interface at /graphiql",
|
||||
format: Boolean,
|
||||
default: false,
|
||||
env: "ENABLE_GRAPHIQL",
|
||||
@@ -103,7 +103,8 @@ const config = convict({
|
||||
sensitive: true,
|
||||
},
|
||||
signing_secret: {
|
||||
doc: "",
|
||||
doc:
|
||||
"The shared secret to use to sign JSON Web Tokens (JWT) with the selected signing algorithm.",
|
||||
format: "*",
|
||||
default: "keyboard cat", // TODO: (wyattjoh) evaluate best solution
|
||||
env: "SIGNING_SECRET",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import dotenv from "dotenv";
|
||||
import { rewrite } from "env-rewrite";
|
||||
import sourceMapSupport from "source-map-support";
|
||||
|
||||
// Configure the source map support so stack traces will reference the source
|
||||
@@ -7,6 +8,15 @@ sourceMapSupport.install({
|
||||
environment: "node",
|
||||
});
|
||||
|
||||
// Ensure that we always process the rewrites silently, otherwise it may fail in
|
||||
// environments like Heroku.
|
||||
process.env.REWRITE_ENV_SILENT = "TRUE";
|
||||
|
||||
// Perform rewrites to the runtime environment variables based on the contents
|
||||
// of the process.env.REWRITE_ENV if it exists. This is done here as it is the
|
||||
// entrypoint for the entire applications configuration.
|
||||
rewrite();
|
||||
|
||||
// Apply all the configuration provided in the .env file if it isn't already in
|
||||
// the environment.
|
||||
dotenv.config();
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
declare module "env-rewrite" {
|
||||
export function rewrite(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user