expressjs / urlrouter Goto Github PK
View Code? Open in Web Editor NEWhttp url router, `connect` missing router middleware
http url router, `connect` missing router middleware
rt
app.get('/some/path', arrayOfMiddleware);
yields
TypeError: handle must be function, not object
How would you feel about a .all() that matches any verb?
app.redirect('/admin', '/admin/');
Everyone like express routing: http://expressjs.com/guide.html#routing.
support RegExp
ref: expressjs/discussions#134
@fengmk2 - you have been identified as the last / most active committer in this repo which is inactive for a while. This ping is to check with you to determine:
thanks!
In the olden days I could use a route such as
/files/:id/:filename?
and that would match paths like
/files/1234
/files/1234/big
/files/1234/big.png
/files/1234/big-bird
/files/1234/big-bird.png
I just converted an old-old-old app over and this new urlrouter handles that for paths like
/files/1234
/files/1234/big
/files/1234-678/big
But not
/files/1234-678/big.png
/files/1234-678/big-bird
/files/1234-678/big-bird.png
Is that a bug? It seems like it since :id
is matching as expected, so why is :filename
matching differently, y'know?
If not, is there an equivalent?
As a quick and simple fix I expanded to matching
/files/:id/:filename
/files/:id
and that seems to work as expected
Anyway, just wanted to know if "that's how we roll" these days or if it's a bug.
If using http
only, user want to handle page not found themself.
It's looks like it's similar to regex, but with some custom name-group type stuff. It's definitely not the router from connect 1.x (which I maintained for a little while after its abandonment, btw https://github.com/coolaj86/connect_router).
The link provided in "express format routing" is broken, so there aren't any docs there.
When I combine connect.static() and urlrouter static paths return 404 not found error.
node v0.10.13
urlrouter v0.0.5
connect v.2.12.0
please ignore this issue
when set route function is undefined, will throw an error.
TypeError: undefined is not a function
at Object.lookup [as handle] (/Users/mk2/git/todo/node_modules/urlrouter/lib/urlrouter.js:71:18)
at next (/Users/mk2/git/todo/node_modules/connect/lib/proto.js:190:15)
at Object.handle (/Users/mk2/git/todo/node_modules/connect-render/lib/render.js:173:5)
at next (/Users/mk2/git/todo/node_modules/connect/lib/proto.js:190:15)
at Object.handle (/Users/mk2/git/todo/node_modules/connect/lib/middleware/csrf.js:48:88)
at next (/Users/mk2/git/todo/node_modules/connect/lib/proto.js:190:15)
at /Users/mk2/git/todo/node_modules/connect/lib/middleware/session.js:299:9
at /Users/mk2/git/todo/node_modules/connect/lib/middleware/session.js:322:9
at Array.0 (/Users/mk2/git/todo/node_modules/connect/lib/middleware/session/memory.js:52:9)
at EventEmitter._tickCallback (node.js:192:40)
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.