spirit-js / spirit-router Goto Github PK
View Code? Open in Web Editor NEWfast router for spirit
License: ISC License
fast router for spirit
License: ISC License
I have a route :
route.get('/login', loginAction.loginpage)
it is accessible using /login , and /login/ . I wonder if there is options to disable /login/ .
It appears that at present the route matcher detects query strings as a component of the URL path. This requires the query parameter to be explicitly stated in the route like so:
Route.get("/environment?host=:host", ["query"], GET_Environment)
whereas it should be:
Route.get("/environment", ["query"], GET_Environment)
Any thoughts?
It would maybe nice if the router raises correct HTTP errors instead of just returning undefined
.
In my case I would like to distinguish between "Not Found" (404) and "Method Not Allowed" (405), in case that the route exists but just with an other method.
Currently I'm fetching the undefined
and raise a "Not Found" error. (not perfect solution)
Hi @hnry, how can I get the body post
data?
Hey @hnry, I have another question for you.
When I try to create a user with an used email I want to response the status code 422
with the message below:
{
"message": "Email already registered"
}
This is my route:
const register = ({ name, email, password }) =>
new User({ name, email, password: hashSync(password) })
.save() // Promise
How can I do that?
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.