Fix prod api url

This commit is contained in:
pikiou
2021-11-30 16:09:36 +01:00
parent a84c329040
commit 6541de5ff9
7 changed files with 11 additions and 6 deletions

View File

@@ -1,9 +1,8 @@
const PORT = 4000
const HOST =
__SERVER__ && !__DEV__ ? process.env.INTRANET_HOST || "fo.parisestludique.fr" : "localhost"
const API_URL = __DEV__ || __LOCAL__ ? `http://localhost:${PORT}` : "https://fo.parisestludique.fr"
export default {
PORT,
HOST: "0.0.0.0",
API_URL: `http://${HOST}:${PORT}`,
API_URL,
}

View File

@@ -52,7 +52,7 @@ async function getSecret() {
export async function getJwt(email: string): Promise<string> {
const jwt = sign({ user: canonicalEmail(email), permissions: [] }, await getSecret(), {
expiresIn: "7d",
expiresIn: "365d",
})
return jwt
}

View File

@@ -1,6 +1,7 @@
declare const __CLIENT__: boolean
declare const __SERVER__: boolean
declare const __DEV__: boolean
declare const __LOCAL__: boolean
declare module "*.svg"
declare module "*.gif"
@@ -16,6 +17,7 @@ declare namespace NodeJS {
__CLIENT__: boolean
__SERVER__: boolean
__DEV__: boolean
__LOCAL__: boolean
$RefreshReg$: () => void
$RefreshSig$$: () => void
}