-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserve.go
More file actions
22 lines (18 loc) · 730 Bytes
/
serve.go
File metadata and controls
22 lines (18 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//go:build !shiftapidev
package shiftapi
import "net/http"
const devMode = false
// ListenAndServe starts the HTTP server on the given address.
//
// In production builds this is a direct call to [http.ListenAndServe] with
// zero additional overhead.
//
// When built with -tags shiftapidev (used automatically by the Vite plugin),
// the following environment variables are supported:
// - SHIFTAPI_EXPORT_SPEC=<path>: write the OpenAPI spec to the given file
// and exit without starting the server.
// - SHIFTAPI_PORT=<port>: override the port in addr, allowing the Vite
// plugin to automatically assign a free port.
func ListenAndServe(addr string, api *API) error {
return http.ListenAndServe(addr, api)
}