Netlify
Netlify can serve your generated api-out/ directory as a static site.
The current flow is either:
- connect the repo to Netlify and let Netlify build
statikapi buildfor you - or build locally/CI and publish the finished
api-out/folder with the Netlify CLI
Using the CLI
If you already have api-out/, deploy it directly:
netlify deploy --dir=api-out --prod
If you are already inside api-out/, netlify deploy --prod is enough.
Netlify serves the uploaded files over its CDN; the important part is publishing the generated folder, not any special API hosting feature.
Example URL
https://your-site.netlify.app/users/1/index.json
Git Integration
You can connect your Git repository (GitHub, GitLab, Bitbucket, or Azure DevOps) directly to Netlify.
For StatikAPI projects, the usual setup is:
- run
statikapi build - publish
api-out/ - let Netlify redeploy whenever the connected branch changes
Build Hooks & CI/CD Integration
Netlify supports build hooks that trigger new builds and deploys for connected sites.
Example flow:
- StatikAPI runs
statikapi buildlocally or in CI. - Once finished, your CI or other service calls the Netlify build hook URL.
- Netlify starts a fresh build for the configured branch and publishes the result.
Build hooks are best when Netlify is building from source. If you already have a finished api-out/, use the CLI deploy flow instead.
This approach allows seamless automated publishing when your data or endpoints are rebuilt.
Considerations
Netlify’s CDN serves static files globally.
However:
- It’s best suited for small to medium API workloads.
- For larger datasets or high-traffic APIs, consider using an object storage solution such as Amazon S3 or Cloudflare R2.
- You can also host your APIs directly with StatikAPI Cloud (coming soon) — a managed hosting platform for static JSON APIs with automatic builds and versioned deployments.
Recommendation
- For small, simple JSON endpoints or demo APIs → use Netlify
- For larger or frequently updated datasets → use S3, R2, or another object storage service
- Always ensure your build directory (
api-out/) is correctly configured in your Configuration