Skip to content

Commit

Permalink
Allow creating the app without starting it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Sep 13, 2024
1 parent 1496b8e commit 9b4ea9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ promises.readdir(STORIES_DIR, { withFileTypes: true }).then(entries => {
});
});


// set port, listen for requests
const PORT = process.env.PORT || 8081;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}.`);
});
6 changes: 0 additions & 6 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ export function createApp(db: Sequelize): Express {
const app = express();
setupApp(app, db);

// set port, listen for requests
const PORT = process.env.PORT || 8081;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}.`);
});

app.all("*", (req, _res, next) => {
console.log(req.session.id);
next();
Expand Down

0 comments on commit 9b4ea9d

Please sign in to comment.