Closed ConstNW closed 4 years ago
Hey! That is amazing to hear that it's been useful 😄. As for vision I've made it similar to Express/Fastify, unfortunately Haxe doesn't support parameter overloading so I can't make the api compatible fully with any of the nodjs libraries. I am still trying to cement a solid api to go forward with, perhaps you would have some input on which one you would prefer?
Example of a POST request relay:
app.get
makes it confusing it also calls the function for post as well.
app.get(function(request,response)
{
switch (request.method)
{
case Post:
switch (request.path)
{
case "/":
response.sendBytes(request.data);
}
default:
}
});
app.get
but still a decent amount of boiler plate code to do this.
app.create(function(request,response)
{
switch (request.method)
{
case Post:
switch (request.path)
{
case "/":
response.sendBytes(request.data);
}
default:
}
});
get
and post
are defined by app callback functions, but still uses switch statement for path.
app.post(function(request,response)
{
switch (request.path)
{
case "/":
response.sendBytes(request.data);
}
});
app.post("/", function(request,response)
{
response.sendBytes(request.data);
}
@ConstNW update I picked option 2. I hope it works well let me know what you think, I also added some features like query() for url params and serve static files.
Hi! I found your project very interesting and useful, but i have a questions about your vision of the weblink. Did you make it api compatible with nodejs http-server or similar to fastify framework?