ducdetronquito / phoon Goto Github PK
View Code? Open in Web Editor NEWA simple web framework for Nim ๐โก
License: BSD Zero Clause License
A simple web framework for Nim ๐โก
License: BSD Zero Clause License
Is it worth it to be able to run on top of Httpbeast or is the standard http server good enough ?
Any insight on the subject is welcomed :)
After installing phoon
with nimble install phoon
I created main.nim
file with the following contents.
import phoon
var app = new App
app.get("/",
proc (ctx: Context) {.async.} =
ctx.response.body("I am a boring home page")
app.serve(8080)
When I try to run the file with the nim c --run main.nim
I get the following error:
12:55:59 m@khan yapyap โnim c -d:danger --run main.nim
Hint: used config file '/home/m/.choosenim/toolchains/nim-1.6.0/config/nim.cfg' [Conf]
Hint: used config file '/home/m/.choosenim/toolchains/nim-1.6.0/config/config.nims' [Conf]
...............................................................................................................................
/home/m/.nimble/pkgs/phoon-0.1.0/phoon.nim(13, 32) Error: ambiguous identifier: 'Callback' -- use one of the following:
asyncdispatch.Callback: Callback
route.Callback: Callback
My nim version
12:54:47 m@khan ~ โ nim --version
Nim Compiler Version 1.6.0 [Linux: amd64]
Compiled at 2021-10-19
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 727c6378d2464090564dbcd9bc8b9ac648467e38
active boot switches: -d:release
As of yet, we deal directly with asynchttpserver
status code.
Find a way to hide this dependency to the end user and provide our own status code API.
nimble install [email protected]
Downloading https://github.com/ducdetronquito/phoon using git
Tip: 3 messages have been suppressed, use --verbose to show them.
Error: Downloaded package's version does not satisfy requested version range: wanted 0.3.0 got 0.2.0.
Add a nice API to read/write cookies ๐ช
Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
Without url-decoding for a start
Any insight on the potential API is welcomed :)
The code is a big for-loop and it makes potential changes or bug fixes not so straightforward.
First take: go for a state machine.
A wilcard route can currently catch a parameter found in a previous partial match.
Example:
--> /users/{id}/books
--> /use*
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.