DOCUMENTATION / OVERVIEW

Mojara documentation

Build web applications with Mojo. Start with a working Hello World application, then learn routes, request validation, databases and deployment.

Your first application

mojara new hello-world web
cd hello-world
mojara dev

The CLI creates an application and starts its development server. Open the URL printed in the terminal.

Hello World in Mojo

from mojara import App, Request, Response

def home(req: Request) -> Response:
    return Response.html("<h1>Hello, World!</h1>")

def main() raises:
    var app = App()
    app.get("/", home)
    app.run(port=8000)

The handler returns HTML. The route links the URL / to home. The server listens for requests.

Follow the lessons

  1. Installation: get the Mojara command and library.
  2. First application: build and run Hello World.
  3. Routing: add pages, JSON endpoints and POST routes.
  4. Requests and forms: read input and validate it.
  5. Authentication: protect private routes.
  6. Models and databases: read and write persistent data.
  7. Deployment: run behind Nginx and HTTPS.

Find an API

Use the API reference for method signatures, Examples for small programs, and Troubleshooting for common errors.