Skip to content

Troubleshooting API

NUS Digital Twin offers a public API for its data, found at nus-digital-twin.com/api/v1. The site makes use of on-demand rendering to serve a live API See Astro’s documentation.

Looking to learn how to use the API? Go to the API Reference.

The API returns a plain text response instead of JSON

Section titled “The API returns a plain text response instead of JSON”

Ensure that the endpoint file in src/pages/api/v1/*.ts is excluded from pre-rendering.

src/pages/api/v1/example.ts
export const prerender = false;
...