Memory Safe HTTP

Zig's spatial memory safety without garbage collector overhead. Drop-in replacement for Node.js HTTP servers.

Join 1,200+ developers
server.ts
import { createServer } from 'zurg';

const server = createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello, Memory-Safe World!');
});

server.listen(3000, () => {
  console.log('Server running on port 3000');
});

Get Started

Start using Zurg in your project in under 5 minutes.

1

Install Zurg

npm install zurg

Or using yarn:

yarn add zurg
2

Create Your Server

server.ts
import { createServer } from 'zurg';

const server = createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello, Memory-Safe World!');
});

server.listen(3000, () => {
  console.log('Zurg server running on port 3000');
});
3

Run Your Server

npx tsx server.ts

That's it! Your memory-safe server is now running.

Configuration Made Simple

Before (Error-prone)

{
  port: process.env.PORT || 3000,
  host: 'localhost',
  timeout: 5000,
  maxConnections: 100
}

After (Type-safe)

config.ts
{
  port: 3000,
  host: 'localhost',
  timeout: 5000,
  maxConnections: 100
} as const

"Zurg's configuration API uses TypeScript's literal types to catch configuration errors at compile time, preventing runtime crashes."