Skip to content

DTS-STN/nextjs-config-poc

Repository files navigation

This is a proof of concept demonstrating how to fetch client-side configuration via a fetch() call to an /api/client-config endpoint.

This strategy enables build-once-run-anywhere Next.js container images.

Run dev server

NEXT_PUBLIC_API_URL=https://reqres.in/api/users npm run dev

Run non-dev server

npm run build
NEXT_PUBLIC_API_URL=https://reqres.in/api/users npm start

You can replace the API URL with any API that returns JSON data.
ex: NEXT_PUBLIC_API_URL=https://reqres.in/api/users/2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published