Add hostname configuration option
This commit is contained in:
@@ -230,7 +230,7 @@ const app = new Elysia()
|
|||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect(config.NODE_ENV === "production" ? "https://music.renati.me/" : "http://localhost:5173/", 303) as unknown as void;
|
return redirect(config.NODE_ENV === "production" ? `https://${config.HOSTNAME}/` : "http://localhost:5173/", 303) as unknown as void;
|
||||||
}, {
|
}, {
|
||||||
response: {
|
response: {
|
||||||
303: t.Void(),
|
303: t.Void(),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Db } from "./services/db";
|
|||||||
import { Session } from "./services/session";
|
import { Session } from "./services/session";
|
||||||
|
|
||||||
export const OAUTH_SCOPE = "email offline_access openid profile https://graph.microsoft.com/User.Read.All";
|
export const OAUTH_SCOPE = "email offline_access openid profile https://graph.microsoft.com/User.Read.All";
|
||||||
export const REDIRECT_URI = config.NODE_ENV === "production" ? "https://music.renati.me/api/v1/login" : "http://localhost:3000/api/v1/login";
|
export const REDIRECT_URI = config.NODE_ENV === "production" ? `https://${config.HOSTNAME}/api/v1/login` : "http://localhost:3000/api/v1/login";
|
||||||
|
|
||||||
export const EXPIRATION_BUFFER = Duration.seconds(10);
|
export const EXPIRATION_BUFFER = Duration.seconds(10);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const Config = Schema.Struct({
|
|||||||
Schema.String,
|
Schema.String,
|
||||||
Schema.optional,
|
Schema.optional,
|
||||||
),
|
),
|
||||||
|
HOSTNAME: Schema.String,
|
||||||
NODE_ENV: pipe(
|
NODE_ENV: pipe(
|
||||||
Schema.Literal("development", "production"),
|
Schema.Literal("development", "production"),
|
||||||
Schema.optionalWith({ default: constant("development" as const) }),
|
Schema.optionalWith({ default: constant("development" as const) }),
|
||||||
|
|||||||
Reference in New Issue
Block a user