{}const=>[]async()letfn</>var
Development

Serverless without complicated words: launch your API in 10 minutes

Learn what Serverless is in simple words, and create your API in 10 minutes without configuring servers. Step-by-step guide + lessons in the Kodik app.

К

Kodik

Author

2 min read

🧩 What is Serverless anyway?

Serverless is a model where you write code as a set of functions, and the provider (Vercel, Cloudflare, AWS, Google) runs them on request. You don't rent a server "permanently", but only pay for the actual function calls — like a taxi instead of a car.

The result: faster start, less infrastructure, easier support.

🔥 100,000+ students already with us

Tired of reading theory?
Time to code!

Kodik — an app where you learn to code through practice. AI mentor, interactive lessons, real projects.

🤖 AI 24/7
🎓 Certificates
💰 Free
🚀 Start learning
Joined today

⚙️ We run our API on Vercel (though, in ~10 minutes)

  1. Install the CLI:

    npm i -g vercel
  2. Create a project folder:

    mkdir my-api && cd my-api
  3. Add the api/hello.js function file:

    export default function handler(req, res) {
      res.status(200).json({ message: "Hello, world!" });
    }
  4. Deposit:

    vercel

    The answer will be a URL like:

    https://my-api.vercel.app/api/hello

You can check vercel dev locally.

⏱️ Why does it come out so quickly

There is no manual server setup — the platform will do everything for you.

Scaling "on demand" — no need to keep a powerful instance 24/7.

Payment for actual performance (or free limits for start).

Templates and autoconfig: less documentation — more work.

📌 Ideal cases for Serverless

  • Prototypes and MVP.

  • Forms on landing pages (processing requests, webhooks).

  • Microservices and cron tasks.

  • Chatbots, notifications, easy APIs.

⚠️ What to pay attention to

  • Time limit (often 10–30 seconds per request).

  • Cold start on some platforms.

  • Not for heavy calculations and long connections.

  • Binding to the provider (configuration and API features).

🧪 Mini-upgrade: route with parameters

Add an endpoint that greets by name: api/hi.js

export default function handler(req, res) {
  const { name = "Guest" } = req.query;
  res.status(200).json({ hello: `Hi ${name}!` });
}

Request: /api/hi?name=Kodik → response {"hello":"Hi, Kodik!"}

Serverless is a great way to quickly release a working API and not waste time on infrastructure.

📚 Do you want to delve into the topic?

In the attachment Code you will find detailed lessons on various topics, step-by-step exercises, error analysis and convenient practice right on your phone or browser.

And if you want to be aware of the news, new features and useful materials - subscribe to our Telegram channel. It's cozy, businesslike and with love for code ❤️

🎯Stop procrastinating

Liked the article?
Time to practice!

In Kodik, you don't just read — you write code immediately. Theory + practice = real skills.

Instant practice
🧠AI explains code
🏆Certificate

No registration • No card