DEV Community

Alex Spinov
Alex Spinov

Posted on

Val Town Has a Free Serverless Platform That Runs TypeScript in Your Browser — Like CodePen for Backends

The Serverless Problem

AWS Lambda: write code, configure IAM, set up API Gateway, deploy with SAM. Cloudflare Workers: wrangle wrangler.toml. Both: too much ceremony for a simple function.

Val Town lets you write a serverless function in your browser. Share it with a URL. No deploy step.

What Val Town Gives You

HTTP Endpoints in One Function

export default async function(req: Request): Promise<Response> {
  const url = new URL(req.url);
  const name = url.searchParams.get('name') || 'World';
  return Response.json({ message: `Hello, ${name}!` });
}
// Live at: https://username-functionname.web.val.run
Enter fullscreen mode Exit fullscreen mode

Save → instantly deployed. No CLI. No config files.

Cron Jobs

export default async function() {
  const response = await fetch('https://api.example.com/health');
  if (!response.ok) {
    await email('admin@example.com', 'Service is down!');
  }
}
// Runs every 5 minutes automatically
Enter fullscreen mode Exit fullscreen mode

Email Handler

export default async function(email: Email) {
  // Receives emails at yourname.functionname@valtown.email
  console.log(`From: ${email.from}`);
  console.log(`Subject: ${email.subject}`);
  await saveToDatabase(email);
}
Enter fullscreen mode Exit fullscreen mode

Built-In SQLite

import { sqlite } from 'https://esm.town/v/std/sqlite';

await sqlite.execute(`
  CREATE TABLE IF NOT EXISTS bookmarks (url TEXT, title TEXT)
`);

await sqlite.execute(
  'INSERT INTO bookmarks VALUES (?, ?)',
  ['https://example.com', 'Example']
);

const bookmarks = await sqlite.execute('SELECT * FROM bookmarks');
Enter fullscreen mode Exit fullscreen mode

Blob Storage

import { blob } from 'https://esm.town/v/std/blob';

await blob.setJSON('config', { theme: 'dark', lang: 'en' });
const config = await blob.getJSON('config');
Enter fullscreen mode Exit fullscreen mode

Import Any npm Package

import Anthropic from 'npm:@anthropic-ai/sdk';

const client = new Anthropic();
const message = await client.messages.create({
  model: 'claude-sonnet-4-20250514',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }],
});
Enter fullscreen mode Exit fullscreen mode

Free Tier

  • Unlimited vals (functions)
  • 10 cron jobs
  • SQLite database
  • Blob storage
  • Custom domains

Why This Matters

Not every idea needs a repo, a CI pipeline, and a cloud provider. Val Town makes it possible to go from idea to deployed API in 30 seconds.


Building data automations? Check out my web scraping actors on Apify Store — structured data for your Val Town functions. For custom solutions, email spinov001@gmail.com.

Top comments (0)