A simple notes API example with a PostgreSQL database.
index.js- HTTP server with CRUD endpoints for notespackage.json- Node.js project with pg dependencyspecific.hcl- Specific configuration with database
The specific.hcl defines:
- A PostgreSQL database named "main"
- A build configuration with automatic dependency installation
- A service that runs the Node.js server
- The
DATABASE_URLenvironment variable is automatically injected from the database
GET /notes- List all notesPOST /notes- Create a note (body:{"content": "..."})GET /health- Health check