Install Lightning
Add Lightning to your Go module:If you don’t have a module yet, initialize one first:
Run the server
Start the server:You should see output similar to:
Lightning listens on port 6789 by default. You can override this by passing an address to
app.Run(), for example app.Run(":8080"), or by setting the PORT environment variable.What’s next
Now that your app is running, explore the core concepts:- Routing — add URL parameters, wildcards, and multiple HTTP methods
- Middleware — write custom middleware and apply it globally or to specific routes
- Context API — read request data and send structured responses
- Route groups — organize routes under shared prefixes with scoped middleware