# Node Express API

A small Express API returns its Node.js version, reports its health, and lets you list or add todos. Tokay gives it a live URL as one Web Service.

This is the familiar Express shape many Node.js projects start with. You can deploy the ordinary server and `package.json` without teaching the app about Tokay.

## Facts

- Runtime: Node.js
- Framework: Express
- Service types: Web Service
- Resources: None
- Required secrets: None

## What it does

Open the root route to see which Node.js runtime is serving your app.

The `/todos` route starts with three sample items. Send it a title with `POST` and the API returns the new todo with its ID.

Send an empty title and you get a clear validation error. The `/health` route gives you a small liveness check.

## Deploy it

Bring this folder to Tokay any way you like. Paste or upload it in the dashboard, push it with git, or hand it to your AI agent along with [our agent instructions](https://app.tokay.io/llms.txt). Tokay figures out the rest.

Working in Claude, ChatGPT, VS Code, or another MCP client? Connect the [Tokay MCP server](https://tokay.io/docs/platform-mcp) and ask your agent to deploy this example. It signs in through your browser, so there is no token to paste.

New to Tokay? The [getting started guide](https://tokay.io/getting-started) walks you through your first deploy.

## Try it

Replace the placeholder with your live URL, add one todo, then fetch the list.

```sh
export APP_URL="https://your-app.tokay.app"
curl -X POST "$APP_URL/todos" \
  -H 'Content-Type: application/json' \
  -d '{"title":"ship the next thing"}'
curl "$APP_URL/todos"
```

Your new todo appears in the list. Deploy again and the three samples return because this starter deliberately keeps data in memory.

## How it works

You can keep the same Express entry point you use locally. Tokay installs the packages, supplies `PORT`, starts the server, and routes the live URL to it.

## Secrets

You can call every route without a secret or an outside account.

## Grow from here

Try the [PostgreSQL task tracker](/examples/node-express-postgres-task-tracker) when you want todos to survive a restart.

## Source files

- [package.json](https://tokay.io/examples/src/node-express-api/package.json)
- [server.js](https://tokay.io/examples/src/node-express-api/server.js)

## Download and source

- [Download the complete project](https://tokay.io/examples/downloads/node-express-api.zip)
- Last updated: 2026-07-31
- Example revision: `52c7b7f`
- [View this revision on GitHub](https://github.com/tokayio/tokay-examples/tree/52c7b7ffd52e157375b08f1f11ff4fbe6c498642/node-express-api)
- [Deploy an Express app](https://tokay.io/use-cases/deploy-express)
