Serve Spa
GET
/{path}
const url = 'https://example.com/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/exampleServe React SPA.
- If the requested path matches a file in static dir, serve it
- Otherwise, serve index.html for client-side routing
index.html is served with no-store to ensure the browser always fetches the latest version (asset filenames contain content hashes).
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”path
required
Path
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Examplegenerated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}