Developer Guide
Getting started
Getting Started
This guide will walk you through setting up the REST Countries API project locally.
Prerequisites
- Node.js: Ensure you have Node.js installed. You can download it from nodejs.org.
- Package Manager: This project uses Bun by default (
bun.lock
present), but you can also use npm (comes with Node.js), yarn, or pnpm. - Git: You need Git to clone the repository.
Installation & Configuration
-
Clone the repository:
-
Install dependencies: Choose the command corresponding to your preferred package manager:
- Configuration:
- The primary configuration for deployment and local development settings (like the development server port) is handled by
wrangler.jsonc
(orwrangler.toml
). Review this file if you need to adjust settings. - For standard local development, no specific environment variables are typically required unless you modify the code to depend on them or configure Cloudflare secrets that might be needed even locally (less common).
- The primary configuration for deployment and local development settings (like the development server port) is handled by
Local Development Server
To run the development server, which provides hot-reloading:
The API should now be running locally. By default, it’s usually accessible at http://localhost:8787
. Check the output in your terminal or the wrangler.jsonc
file for the exact port.
You can now make requests to the local endpoints (e.g., http://localhost:8787/api/v1/all
).