style: update env path in global env
This commit is contained in:
parent
5c633ae38c
commit
2a3e232f55
@ -1,6 +1,7 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { publicProcedure, router } from '../trpc';
|
import { publicProcedure, router } from '../trpc';
|
||||||
import { OPENAPI_TAG } from '../../utils/const';
|
import { OPENAPI_TAG } from '../../utils/const';
|
||||||
|
import { env } from '../../utils/env';
|
||||||
|
|
||||||
export const globalRouter = router({
|
export const globalRouter = router({
|
||||||
config: publicProcedure
|
config: publicProcedure
|
||||||
@ -23,10 +24,10 @@ export const globalRouter = router({
|
|||||||
)
|
)
|
||||||
.query(async ({ input }) => {
|
.query(async ({ input }) => {
|
||||||
return {
|
return {
|
||||||
allowRegister: checkEnvTrusty(process.env.ALLOW_REGISTER),
|
allowRegister: env.allowRegister,
|
||||||
websiteId: process.env.WEBSITE_ID,
|
websiteId: env.websiteId,
|
||||||
amapToken: process.env.AMAP_TOKEN,
|
amapToken: env.amapToken,
|
||||||
mapboxToken: process.env.MAPBOX_TOKEN,
|
mapboxToken: env.mapboxToken,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -8,6 +8,8 @@ export const env = {
|
|||||||
? Number(process.env.SANDBOX_MEMORY_LIMIT)
|
? Number(process.env.SANDBOX_MEMORY_LIMIT)
|
||||||
: 16, // unit: MB
|
: 16, // unit: MB
|
||||||
dbDebug: checkEnvTrusty(process.env.DB_DEBUG),
|
dbDebug: checkEnvTrusty(process.env.DB_DEBUG),
|
||||||
|
amapToken: process.env.AMAP_TOKEN,
|
||||||
|
mapboxToken: process.env.MAPBOX_TOKEN,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function checkEnvTrusty(env: string | undefined): boolean {
|
export function checkEnvTrusty(env: string | undefined): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user