Просмотр исходного кода

refactor(server): Move api constants into shared

Michael Bromley 7 лет назад
Родитель
Сommit
a86c1bcc6c
2 измененных файлов с 9 добавлено и 2 удалено
  1. 3 2
      server/dev-config.ts
  2. 6 0
      shared/shared-constants.ts

+ 3 - 2
server/dev-config.ts

@@ -1,11 +1,12 @@
+import { API_PATH, API_PORT } from '../shared/shared-constants';
 import { VendureConfig } from './src/config/vendure-config';
 import { VendureConfig } from './src/config/vendure-config';
 
 
 /**
 /**
  * Config settings used during development
  * Config settings used during development
  */
  */
 export const devConfig: VendureConfig = {
 export const devConfig: VendureConfig = {
-    port: 3000,
-    apiPath: 'api',
+    port: API_PORT,
+    apiPath: API_PATH,
     cors: true,
     cors: true,
     jwtSecret: 'some-secret',
     jwtSecret: 'some-secret',
     dbConnectionOptions: {
     dbConnectionOptions: {

+ 6 - 0
shared/shared-constants.ts

@@ -0,0 +1,6 @@
+/*
+ * This file contains constants which are shared between more than one sub-module
+ * e.g. values required by both the server and admin-ui.
+ */
+export const API_PORT = 3000;
+export const API_PATH = 'api';