feat: add backend-mock app

This commit is contained in:
vben
2024-06-30 14:09:44 +08:00
parent c58aa26dbf
commit ca1cad0cd3
71 changed files with 3420 additions and 735 deletions

View File

@@ -0,0 +1,23 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import process from 'node:process';
import * as yaml from 'js-yaml';
const configFileNameObj = {
development: 'dev',
production: 'prod',
};
const env = process.env.NODE_ENV;
const configFactory = () => {
return yaml.load(
readFileSync(
join(process.cwd(), 'src', 'config', `${configFileNameObj[env]}.yml`),
'utf8',
),
) as Record<string, any>;
};
export default configFactory;