mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-28 18:08:51 +05:00
Compare commits
1 Commits
f42d548105
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c988c762a9 |
15
netlify.toml
Normal file
15
netlify.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[build]
|
||||||
|
functions = "netlify/functions"
|
||||||
|
|
||||||
|
[build.environment]
|
||||||
|
GO_VERSION = "1.22.6"
|
||||||
|
|
||||||
|
# Optional: include static assets used by handlers (placeholders, etc.)
|
||||||
|
[functions]
|
||||||
|
included_files = ["assets/**", "public/**", "static/**"]
|
||||||
|
|
||||||
|
# Route all API requests to the serverless function "api"
|
||||||
|
[[redirects]]
|
||||||
|
from = "/api/*"
|
||||||
|
to = "/.netlify/functions/api/:splat"
|
||||||
|
status = 200
|
||||||
15
netlify/functions/api.go
Normal file
15
netlify/functions/api.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
bridge "github.com/vercel/go-bridge/go/bridge"
|
||||||
|
handler "neomovies-api/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
bridge.Start(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
handler.Handler(w, r.WithContext(context.Background()))
|
||||||
|
}))
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user