mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-09-12 16:23:12 +08:00
Fixed express port issue
This commit is contained in:
parent
6169ff5255
commit
5eceb8d72b
5
backend/src/vendor/express.js
vendored
5
backend/src/vendor/express.js
vendored
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable no-undef */
|
/* eslint-disable no-undef */
|
||||||
import { ENV } from './open-api';
|
import { ENV } from './open-api';
|
||||||
|
|
||||||
export default function express({ substore: $, port } = { port: 3000 }) {
|
export default function express({ substore: $, port }) {
|
||||||
|
port = port || process.env.PORT || 3000;
|
||||||
const { isNode } = ENV();
|
const { isNode } = ENV();
|
||||||
const DEFAULT_HEADERS = {
|
const DEFAULT_HEADERS = {
|
||||||
'Content-Type': 'text/plain;charset=UTF-8',
|
'Content-Type': 'text/plain;charset=UTF-8',
|
||||||
@ -29,7 +30,7 @@ export default function express({ substore: $, port } = { port: 3000 }) {
|
|||||||
// adapter
|
// adapter
|
||||||
app.start = () => {
|
app.start = () => {
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
$.log(`Express started on port: ${port}`);
|
$.info(`Express started on port: ${port}`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return app;
|
return app;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user