Skip to content

Commit

Permalink
fix: port and some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rolu01 committed May 3, 2024
1 parent 681fc04 commit c3049b5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/lib/setup-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { logger, httpLogger } from './logger.js';

dotenv.config();

const port = process.env.ONIFY_API_INTERNAL_PORT || 8585;
const port = process.env.PORT || 8585;
const resourceURL = `${process.env.ONIFY_API_URL}/admin/resources/file?stream=false&path=`;
const listResourcesURL = `${process.env.ONIFY_API_URL}/admin/resources?tree=true`;
const resourcesHistoryURL = `${process.env.ONIFY_API_URL}/admin/resources/history`;
Expand All @@ -25,17 +25,22 @@ async function setupApp() {
app.use(httpLogger);

// Increase the limit for JSON payloads
app.use(express.json(({ limit: "50mb", extended: true, parameterLimit: 50000 })));
app.use(
express.json({ limit: '50mb', extended: true, parameterLimit: 50000 })
);

// Increase the limit for plain text payloads
app.use(express.text(({ limit: "50mb", extended: true, parameterLimit: 50000 })));
app.use(
express.text({ limit: '50mb', extended: true, parameterLimit: 50000 })
);

await nodeRun(app);
// await pwshRun(app); TODO: To be implemented


app.listen(port, () => {
logger.info(`Server is running on port ${port}`);
logger.info(
`Server is running on port ${port} in ${process.env.NODE_ENV} mode.`
);
});
return app;
}
Expand Down

0 comments on commit c3049b5

Please sign in to comment.