Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multiple server #1524

Closed
1 of 3 tasks
adamchengtkc opened this issue Dec 20, 2023 · 1 comment
Closed
1 of 3 tasks

support for multiple server #1524

adamchengtkc opened this issue Dec 20, 2023 · 1 comment
Labels

Comments

@adamchengtkc
Copy link

I have two sets of controller that I would like to serve on two different ports. I have looked at #713 but it seems to focus on generating spec.

I have tried manually importing controller according to https://tsoa-community.github.io/docs/routes.html
but the second app would come in empty

Sorting

  • I'm submitting a ...

    • bug report
    • feature request
    • support request
  • I confirm that I

    • [ X] used the search to make sure that a similar issue hasn't already been submit

Expected Behavior

Like in vanilla express, possibility to run two separate server on different ports

const app = express();
app.listen(6001, () =>
  console.log(`Serving at port 6001`)
);
const app2 = express();
app2.listen(6001, () =>
  console.log(`Serving at port 6001`)
);

Current Behavior

I have tried manually importing controller according to https://tsoa-community.github.io/docs/routes.html
but the second app would come in empty

import "./controller/app"
const app= express()
RegisterRoutes(app)
app.listen(6000, () =>
  console.log(`Serving at port 6001`)
);

import "./controller/app1"
const app1= express()
RegisterRoutes(app1)
app1.listen(6001, () =>
  console.log(`Serving at port 6001`)
);

Possible Solution

Steps to Reproduce

Context (Environment)

Version of the library: 20.9.0
Version of NodeJS: 5.1.1

  • Confirm you were using yarn not npm: [x]

Detailed Description

Breaking change?

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant