
Val Town Has a Free API: Write and Deploy JavaScript Functions Instantly
What if deploying an API endpoint was as easy as writing a tweet? Val Town makes serverless functions feel like a REPL. What Is Val Town? Val Town is a platform where every function you write is instantly deployed as an API endpoint. No git push. No CI/CD. No infrastructure. // This is immediately live at val.town/v/yourname/hello export default function ( req : Request ): Response { return Response . json ({ message : " Hello from Val Town! " }) } Save. It's deployed. You get a URL. That's the whole workflow. Types of Vals HTTP vals — API endpoints: export default async function ( req : Request ): Response { const url = new URL ( req . url ) const name = url . searchParams . get ( " name " ) ?? " World " return Response . json ({ greeting : \ `Hello, \$ {name}! \` }) } // GET https://yourname-hello.web.val.run?name=Alice Cron vals — Scheduled functions: export default async function () { const res = await fetch ( " https://api.github.com/repos/denoland/deno " ) const { stargazers_coun
Continue reading on Dev.to JavaScript
Opens in a new tab


