Simple Express app

👉 Closed beta notice

Tessl framework is in private beta. Join our community to be updated on our future product releases.

You can use Tessl to create spec-driven applications from scratch! Starting with a basic spec for an app gives you an easy template to expand upon, building up useful context along the way.

In this example, we'll create a simple one-page Express app using the Tessl MCP server via Claude Code.

With Tessl initialized, and Claude Code set up, we're able to drive this process with a simple prompt:

Claude Code will invoke the create MCP tool, which will give us a simple starter spec. We encourage you to take ownership of this spec — make sure it captures the requirements you want.

Example spec for a simple Express app
# Hello World Express Server

A simple Express.js application that serves a "Hello World!" message on the root route.

## Target

[@generate](../../src/hello-world/hello-world.js)

## Capabilities

### Starts HTTP server on port 3000

- Server starts successfully and listens on port 3000

### Serves Hello World message on root route

- GET request to "/" returns "Hello World!" with status 200

### Handles errors gracefully

- Server handles unexpected errors without crashing

## API

```javascript { .api }
// Express application instance
const app = express();

// Start server function - returns the HTTP server instance synchronously
function startServer(port = 3000); // Returns server object with .close(), .on(), .listening properties

// Root route handler
app.get('/', (req, res) => {
  // Returns "Hello World!" message
});

// Error handling middleware
app.use((err, req, res, next) => {
  // Handles errors gracefully
});
```

## Dependencies

### Express.js Framework

Web framework for Node.js to handle HTTP requests and responses.
[@use](express)

Example output from Claude Code when asked to create a "Hello World" express app using Tessl:

Once you’ve got the initial spec, you can:

  • Add a new route

  • Add middleware

  • Expand test cases

  • Integrate with other services, like DBs, queues, or APIs

Simply ask Claude to add any of these things to the spec for you, or to create related specs. Claude will invoke the edit tool to update your spec, and build for you when you want to try out the changes yourself.

Example follow up request to additional functionality

Last updated