Skip to content

Getting started

You are about to put a Function on the internet and open the URL it answers on. It is three commands, starting from an empty directory.

Two words come up before anything else. An App is a site, with an address of its own. A Function is a route in that site: the code that answers one path. You name one of each along the way.

Node 22.13 or newer:

node --version

That is the whole list. npx comes with Node and fetches the CLI each time you name it, so there is nothing to install.

npx wawesome login

Your browser opens on the wawesome sign-in page, and everything happens there. The page says your terminal is waiting, shows the address on your machine the sign-in goes back to, and counts down the minutes you have left to finish.

If this is your first time here, you make your workspace on that same page. It asks what to call it and what address it should answer at, offering your name in address form, and it takes your acceptance of the terms. Go back to your terminal and you are signed into the workspace you just made:

  Workspace: Hello Co
  Address:   hello-co

That address is the first half of the hostname every Function you deploy answers on. You can change it for free until you deploy. After that you can rename once every 30 days, and the old address redirects for 90 days, so this is the best moment to pick one you are happy with. Concepts says what else your workspace holds.

mkdir hello && cd hello
npx wawesome init

It asks for the Function name and the App slug, and both default to the directory name. Answer hello and demo. Both go into the public URL, so the CLI reference has the rules on what you may type. Concepts says more about Apps and Functions.

It writes src/index.ts, which is the whole Function:

export default {
  async fetch(request: Request): Promise<Response> {
    return Response.json({
      message: "Hello, World!",
    });
  },
};
npx wawesome deploy

It builds the Function, uploads it, and promotes it to production:

  URL:        https://hello-co--demo.wawesome.app/hello
              Every path beneath this address reaches the Function.

Ask it for something:

curl https://hello-co--demo.wawesome.app/hello
{"message":"Hello, World!"}

npx wawesome init --template <name> takes one of the templates from nothing to a deployed Function in a single command, asking for the values it declares on the way.