gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.07k stars 573 forks source link

feature: how to open two or many port for app? #2383

Closed itildesk closed 10 months ago

itildesk commented 1 year ago

Description

sometimes biz require more than one port buffalo support this feature?

Additional Information

No response

pierredup commented 12 months ago

@itildesk Do you want to run the same app on multiple ports, with the same routes? If that is the case, then you can just update your cmd/app/main.go file to run multiple servers with different ports

func main() {
    app := actions.App()

    appOne := servers.New()
    appTwo := servers.New()

    appOne.Addr = ":3000"
    appTwo.Addr = ":3001"

    if err := app.Serve(appOne, appTwo); err != nil {
        log.Fatal(err)
    }
}
itildesk commented 12 months ago

@pierredup thanks for your suggest,I followed what you said, the program has an additional access entrance, and the background process has not changed.

github-actions[bot] commented 11 months ago

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

github-actions[bot] commented 10 months ago

This issue was closed because it has been stalled for 30+7 days with no activity.