Running Your App
Your first endpoint is ready. Now you can build and run the application using the Mach CLI.
Run the Application
Section titled “Run the Application”Run your application using the Mach CLI:
mach runMach builds the project and starts the application.
Once the server is running, you’ll see output indicating that Mach is listening for requests.
Send a Request
Section titled “Send a Request”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.
Stopping the Application
Section titled “Stopping the Application”To stop the running application, return to the terminal and press
Ctrl+C.
Where to Go Next
Section titled “Where to Go Next”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.