mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-10 01:24:20 +02:00
Fix prod api url
This commit is contained in:
parent
a84c329040
commit
6541de5ff9
@ -55,5 +55,6 @@ module.exports = {
|
|||||||
__CLIENT__: true,
|
__CLIENT__: true,
|
||||||
__SERVER__: true,
|
__SERVER__: true,
|
||||||
__DEV__: true,
|
__DEV__: true,
|
||||||
|
__LOCAL__: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ module.exports = {
|
|||||||
__DEV__: true,
|
__DEV__: true,
|
||||||
__CLIENT__: true,
|
__CLIENT__: true,
|
||||||
__SERVER__: false,
|
__SERVER__: false,
|
||||||
|
__LOCAL__: false,
|
||||||
},
|
},
|
||||||
maxConcurrency: 50,
|
maxConcurrency: 50,
|
||||||
maxWorkers: 1,
|
maxWorkers: 1,
|
||||||
|
@ -41,9 +41,9 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "yarn dev:build && nodemon ./public/server",
|
"dev": "yarn dev:build && nodemon ./public/server",
|
||||||
"dev:build": "cross-env NODE_ENV=development webpack --config ./webpack/server.config.ts",
|
"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",
|
"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": "run-s build:*",
|
||||||
"build:server": "cross-env NODE_ENV=production webpack --config ./webpack/server.config.ts",
|
"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",
|
"build:client": "cross-env NODE_ENV=production webpack --config ./webpack/client.config.ts",
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
const PORT = 4000
|
const PORT = 4000
|
||||||
const HOST =
|
const API_URL = __DEV__ || __LOCAL__ ? `http://localhost:${PORT}` : "https://fo.parisestludique.fr"
|
||||||
__SERVER__ && !__DEV__ ? process.env.INTRANET_HOST || "fo.parisestludique.fr" : "localhost"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
PORT,
|
PORT,
|
||||||
HOST: "0.0.0.0",
|
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> {
|
export async function getJwt(email: string): Promise<string> {
|
||||||
const jwt = sign({ user: canonicalEmail(email), permissions: [] }, await getSecret(), {
|
const jwt = sign({ user: canonicalEmail(email), permissions: [] }, await getSecret(), {
|
||||||
expiresIn: "7d",
|
expiresIn: "365d",
|
||||||
})
|
})
|
||||||
return jwt
|
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 __CLIENT__: boolean
|
||||||
declare const __SERVER__: boolean
|
declare const __SERVER__: boolean
|
||||||
declare const __DEV__: boolean
|
declare const __DEV__: boolean
|
||||||
|
declare const __LOCAL__: boolean
|
||||||
|
|
||||||
declare module "*.svg"
|
declare module "*.svg"
|
||||||
declare module "*.gif"
|
declare module "*.gif"
|
||||||
@ -16,6 +17,7 @@ declare namespace NodeJS {
|
|||||||
__CLIENT__: boolean
|
__CLIENT__: boolean
|
||||||
__SERVER__: boolean
|
__SERVER__: boolean
|
||||||
__DEV__: boolean
|
__DEV__: boolean
|
||||||
|
__LOCAL__: boolean
|
||||||
$RefreshReg$: () => void
|
$RefreshReg$: () => void
|
||||||
$RefreshSig$$: () => void
|
$RefreshSig$$: () => void
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import LoadablePlugin from "@loadable/webpack-plugin"
|
|||||||
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"
|
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"
|
||||||
|
|
||||||
export const isDev = process.env.NODE_ENV === "development"
|
export const isDev = process.env.NODE_ENV === "development"
|
||||||
|
const isLocal = process.env.LOCAL === "true"
|
||||||
const getStyleLoaders = (isWeb: boolean, isSass?: boolean) => {
|
const getStyleLoaders = (isWeb: boolean, isSass?: boolean) => {
|
||||||
let loaders: RuleSetUseItem[] = [
|
let loaders: RuleSetUseItem[] = [
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ const getPlugins = (isWeb: boolean) => {
|
|||||||
__CLIENT__: isWeb,
|
__CLIENT__: isWeb,
|
||||||
__SERVER__: !isWeb,
|
__SERVER__: !isWeb,
|
||||||
__DEV__: isDev,
|
__DEV__: isDev,
|
||||||
|
__LOCAL__: isLocal,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user