mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-04-22 15:57:52 +02:00
updated apis.Serve godoc
This commit is contained in:
parent
6baae97b5d
commit
1e995552c8
@ -37,6 +37,16 @@ type ServeConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Serve starts a new app web server.
|
// Serve starts a new app web server.
|
||||||
|
//
|
||||||
|
// NB! The app should be bootstrapped before starting the web server.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// app.Bootstrap()
|
||||||
|
// apis.Serve(app, apis.ServeConfig{
|
||||||
|
// HttpAddr: "127.0.0.1:8080",
|
||||||
|
// ShowStartBanner: false,
|
||||||
|
// })
|
||||||
func Serve(app core.App, config ServeConfig) (*http.Server, error) {
|
func Serve(app core.App, config ServeConfig) (*http.Server, error) {
|
||||||
if len(config.AllowedOrigins) == 0 {
|
if len(config.AllowedOrigins) == 0 {
|
||||||
config.AllowedOrigins = []string{"*"}
|
config.AllowedOrigins = []string{"*"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user