Lightning Server comes with a bunch of easy tools for working with your server.
You can enable them just like this:
object Server : ServerPathGroup(ServerPath.root) {
val meta = path("meta").metaEndpoints<User>(
// We only let admins access some tools, like the metrics and health endpoints.
isAdmin = { it: User -> it.email.endsWith("@lightningkite.com") }
)
}
Now, if you visit your server's /meta
page, you'll have access to several convenient tools.
Some plain text documentation for all of your typed endpoints and their associated types.
Also contains a link to get SDKs for several programming languages.
A JSON-returning endpoint that will report the health status of your system, including memory usage, load, and health statuses for each individual dependent system such as caches, database, files, and emails.
Simply returns the plain-text 200 response "Server is running." Can be useful for quick checks.
A React-driven administrative panel that allows for management of any models you've exposed RESTful endpoints for, as well as testers for your endpoints.
Automatically-generated Swagger docs.
Automatically-generated OpenAPI JSON spec.
Returns a Lightning Server specific schema in JSON.
Returns a list of all paths that the server responds to, as well as all tasks, schedules, and more.
A convenient web socket tester.