mirror of
https://github.com/dotFionn/iassure-wx.git
synced 2026-03-21 06:22:56 -05:00
Make base API path configurable via env variable
This commit is contained in:
@@ -4,14 +4,14 @@ import morgan from 'morgan';
|
|||||||
import router from './router';
|
import router from './router';
|
||||||
import wxService from './services/wx.service';
|
import wxService from './services/wx.service';
|
||||||
|
|
||||||
const { PORT = 3000 } = process.env;
|
const { PORT = 3000, BASE_PATH = '/api' } = process.env;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.set('trust proxy', true);
|
app.set('trust proxy', true);
|
||||||
app.use(morgan('combined'));
|
app.use(morgan('combined'));
|
||||||
|
|
||||||
app.use('/api', router.router);
|
app.use(BASE_PATH, router.router);
|
||||||
|
|
||||||
const frontendRoot = '/opt/frontend/dist';
|
const frontendRoot = '/opt/frontend/dist';
|
||||||
app.use(express.static(frontendRoot));
|
app.use(express.static(frontendRoot));
|
||||||
|
|||||||
Reference in New Issue
Block a user