Prologue
What's past is prologue.
Purpose
Prologue
is a web framework written in Nim.
It is ideal for building elegant and high performance web services.
Reduce magic. Reduce surprise.
Documentation
Documentation | Index Page | |
Core API | Index Page | Search Page |
Full API | Index Page | Search Page |
Features
-
Core
- Base on
httpx
andasynchttpserver
- Configure and Settings
- Context
- Param and Query Data
- Form Data
- Static Files
- Middleware
- Simple Route
- Regex Route
- DSL Route
- CORS Response
- Signing
- Cookie
- Session
- Cache
- Startup and Shutdown Events
- URL Building
- Data Validation
- Exception Handler
- Cross-Site Request Forgery
- Cross-Site Scripting (XSS) Protection(
Karax
quote string automatically) - Clickjacking Protection
- Authentication
- I18n
- Command line tools
- Mocking test
- Base on
-
Plugin
- Minimal OpenAPI support
- Template(Using
Karax
Native) - Websocket support
- Test Client(Using
httpclient
)
Installation
First you should install Nim language which is an elegant and high performance language. Follow the instructions and set environment variables correctly.
Then you can use nimble
command to install prologue
.
nimble install prologue
Usages
Hello World
import prologue
proc hello*(ctx: Context) {.async.} =
resp "<h1>Hello, Prologue!</h1>"
let app = newApp()
app.addRoute("/", hello)
app.run()
Run app.nim ( nim c -r app.nim
). Now the server is running at localhost:8080
.
More examples
Extensions
If you need more extensions, you can refer to awesome prologue and awesome nim.
Donations
Thanks for supporting me!