gobuffalo/buffalo

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

itildesk opened this issue · 4 comments

Description

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

Additional Information

No response

@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)
    }
}

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

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.

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