liteapi
Overview
liteapi is a powerful and easy to use service of litestorm to create REST APIs. Designed with performance in mind, liteapi is highly multithreaded and asynchronous, allowing you to build fast and responsive APIs with ease. With its user-friendly interface and intuitive design, liteapi makes it easy to get started building your own APIs. Whether you’re an experienced developer or just getting started, liteapi provides the tools you need to create powerful and scalable REST APIs.
Features
liteapi gives you a lot of flexibility by having to return a http-response with the given enum and taking the query-params as an argument, this sounds redundant but by doing that you can give the handler function way more flexibility than in other frameworks. Let's make a simple REST API using liteapi that asks for an apikey as a query-param (don't ask for an apikey as a query-param in production):
use ;
entry!
// Note that every handler has to take query-pairs as the one and only argument.
// Also note that the handler can't be asynchronous.
// That's it this api will wait for a request on the default path and give a Forbidden if the apikey is not provided or wrong
Let's add another route to this RESTAPI this time we are going to return some html!
use ;
entry!
// Note that every handler has to take query-pairs as the one and only argument.
// Also note that the handler can't be asynchronous.
// Here you can see even though we are not working with the query-pairs we have to take them as an argument
// This was very easy right? Imagine the possibilities combining these two routes
Here are some more features, that are going to follow soon:
- support for http2.0 and http3.0
- support for oauth2
- support for websockets
- support for positional query params: localhost:7878/{id}/{name}/