What’s past is prologue.
Purpose
Prologue is a Fats-Stack Web Framework which is
very excellent for constructing good and excessive efficiency
net companies and products.
Decrease magic. Decrease shock.
Fresh Work
Now we’re working on rewriting network infrastructure.
https://github.com/iocrate/netkit
Also working on http2.
https://github.com/nimlight/zest
Documentation
You might maybe possible also be taught documentation in https://planety.github.io/prologue.
Characteristic
-
Core
- Unfavorable on httpbeast and asynchttpserver
- Configure and Settings
- Context
- Param and Search files from Data
- Create Data
- Static Files
- Middleware
- Easy Route
- Regex Route
- CORS Response
- Signing
- Cookie
- Session
- Cache
- Startup and Shutdown Events
- URL Building
- Data Validation
- Exception Handler
- Immoral-Spot Search files from Forgery
- Immoral-Spot Scripting (XSS) Safety(Karax quote string routinely)
- Clickjacking Safety
- Authentication
- I18n
-
Plugin
- Minimal OpenApi enhance
- Template(Utilizing Karax Native)
- Check Client(Utilizing httpclient)
Set up
First you ought to composed set up Nim language which is an good and excessive efficiency language.Practice the instructions and space atmosphere variables accurately.
Then you indubitably would maybe maybe also utilize nimble
picture to set up prologue.
Utilization
Hello World
# app.nim import prologue proc hi there*(ctx: Context) {.async.} = resp "Hello, Prologue!
" let settings = newSettings() var app = newApp(settings = settings) app.addRoute("/", hi there) app.bustle()
Traipse app.nim.Now the server is working at localhost: 8080.
One other instance
# app.nim import prologue import prologue/middlewares/middlewares # Async Characteristic proc house*(ctx: Context) {.async.} = resp "Home
" proc helloName*(ctx: Context) {.async.} = resp "Hello, "
& ctx.getPathParams("name", "Prologue") & "" proc doRedirect*(ctx: Context) {.async.} = resp redirect("/hi there") proc login*(ctx: Context) {.async.} = resp loginPage() proc do_login*(ctx: Context) {.async.} = resp redirect("/hi there/Nim") let settings = newSettings(appName = "StarLight") var app = newApp(settings = settings, middlewares = @[debugRequestMiddleware()]) app.addRoute("/", house, @[HttpGet, HttpPost]) app.addRoute("/house", house, HttpGet) app.addRoute("/redirect", doRedirect, HttpGet) app.addRoute("/login", login, HttpGet) app.addRoute("/login", do_login, HttpPost, @[debugRequestMiddleware()]) app.addRoute("/hi there/{name}", helloName, HttpGet) app.bustle()
Traipse app.nim.Now the server is working at localhost: 8080.