Skip to content
Download

Running Your App

Your first endpoint is ready. Now you can build and run the application using the Mach CLI.

Run your application using the Mach CLI:

Terminal window
mach run

Mach builds the project and starts the application.

Once the server is running, you’ll see output indicating that Mach is listening for requests.

Open your browser and navigate to:

http://localhost:3143/

You should see:

Hello, world!

The request is handled by the endpoint defined in src/main.cpp:

app.mapGet("/", [] {
return mach::ok("Hello, world!");
});

You’ve now created, built, and run your first Mach application.

To stop the running application, return to the terminal and press Ctrl+C.

Now that you have a working Mach application, you’re ready to explore more of the framework.

Continue with the guides to learn about routing, controllers, middleware, dependency injection, validation, and other Mach features.