|
|
@ -8,9 +8,8 @@ import express from 'express'; |
|
|
import { dirname, resolve } from 'node:path'; |
|
|
import { dirname, resolve } from 'node:path'; |
|
|
import { fileURLToPath } from 'node:url'; |
|
|
import { fileURLToPath } from 'node:url'; |
|
|
|
|
|
|
|
|
if (process.env['NODE_ENV'] === 'development') { |
|
|
//TODO: Remove this line in production
|
|
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0"; |
|
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0"; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const serverDistFolder = dirname(fileURLToPath(import.meta.url)); |
|
|
const serverDistFolder = dirname(fileURLToPath(import.meta.url)); |
|
|
const browserDistFolder = resolve(serverDistFolder, '../browser'); |
|
|
const browserDistFolder = resolve(serverDistFolder, '../browser'); |
|
|
@ -56,7 +55,7 @@ app.use((req, res, next) => { |
|
|
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. |
|
|
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. |
|
|
*/ |
|
|
*/ |
|
|
if (isMainModule(import.meta.url)) { |
|
|
if (isMainModule(import.meta.url)) { |
|
|
const port = process.env['PORT'] || 4000; |
|
|
const port = process.env['PORT'] || 4200; |
|
|
app.listen(port, () => { |
|
|
app.listen(port, () => { |
|
|
console.log(`Node Express server listening on http://localhost:${port}`); |
|
|
console.log(`Node Express server listening on http://localhost:${port}`); |
|
|
}); |
|
|
}); |
|
|
|