mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-08 08:34:20 +02:00
Fix prod api url
This commit is contained in:
parent
a84c329040
commit
6541de5ff9
@ -55,5 +55,6 @@ module.exports = {
|
||||
__CLIENT__: true,
|
||||
__SERVER__: true,
|
||||
__DEV__: true,
|
||||
__LOCAL__: false,
|
||||
},
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ module.exports = {
|
||||
__DEV__: true,
|
||||
__CLIENT__: true,
|
||||
__SERVER__: false,
|
||||
__LOCAL__: false,
|
||||
},
|
||||
maxConcurrency: 50,
|
||||
maxWorkers: 1,
|
||||
|
@ -41,9 +41,9 @@
|
||||
"scripts": {
|
||||
"dev": "yarn dev:build && nodemon ./public/server",
|
||||
"dev:build": "cross-env NODE_ENV=development webpack --config ./webpack/server.config.ts",
|
||||
"local-start": "cross-env INTRANET_HOST=localhost node ./public/server",
|
||||
"local-start": "cross-env LOCAL=true node ./public/server",
|
||||
"start": "node ./public/server",
|
||||
"local-build": "cross-env INTRANET_HOST=localhost run-s build:*",
|
||||
"local-build": "cross-env LOCAL=true run-s build:*",
|
||||
"build": "run-s build:*",
|
||||
"build:server": "cross-env NODE_ENV=production webpack --config ./webpack/server.config.ts",
|
||||
"build:client": "cross-env NODE_ENV=production webpack --config ./webpack/client.config.ts",
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
2
src/types/index.d.ts
vendored
2
src/types/index.d.ts
vendored
@ -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
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import LoadablePlugin from "@loadable/webpack-plugin"
|
||||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"
|
||||
|
||||
export const isDev = process.env.NODE_ENV === "development"
|
||||
const isLocal = process.env.LOCAL === "true"
|
||||
const getStyleLoaders = (isWeb: boolean, isSass?: boolean) => {
|
||||
let loaders: RuleSetUseItem[] = [
|
||||
{
|
||||
@ -47,6 +48,7 @@ const getPlugins = (isWeb: boolean) => {
|
||||
__CLIENT__: isWeb,
|
||||
__SERVER__: !isWeb,
|
||||
__DEV__: isDev,
|
||||
__LOCAL__: isLocal,
|
||||
}),
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user