Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
222 views

I'm using Express 5.1.0 with Node.js v22.19.0, and I want to define a route where the parameter is optional, like /directory or /directory/someFolder. Here's the code I tried: import express from '...
Arman Ihsan's user avatar
3 votes
2 answers
3k views

I created this simple file: import express from "express"; import type { Request, Response } from "express"; const app = express(); const port = 3000; app.get('/', (req:Request, ...
MOHAMMAD HASHEMI's user avatar
-2 votes
1 answer
58 views

I have one issue with express I want to use "^" as we use it in Javascript regex but unfortunately it does not work... so here i added "^" to give pattern to the storeName path ...
samh's user avatar
  • 41
0 votes
1 answer
285 views

My URL structure is as follows: http://localhost:8888/cdw/work/foo-bar/ http://localhost:8888/cdw/work/bar-foo/ http://localhost:8888/cdw/work/etc-etc/ I'm using swup JS and the route plugin https://...
HandiworkNYC.com's user avatar
0 votes
2 answers
680 views

I have this route path /custom/:length(\\d+-letter-)?words It matches below routes as expected ✅ /custom/3-letter-words /custom/words However, this.$route.params.length returns 3-letter-. My ...
Süleyman Gezsat's user avatar
0 votes
0 answers
65 views

I have these regex expressions: /^\/users\/?(?=\/|$)/i /^\/?$/i Which were generated using a library called Path-to-RegExp The original paths were: /users / So is there any way-however imperfect-...
Omar Dulaimi's user avatar
  • 1,289
1 vote
0 answers
553 views

I've run into a odd problem. When I try to test if path-to-regexp will match a given path I will not get a result when expected, if I pass the input string from a variable. But if I hard-code the ...
zkwsk's user avatar
  • 2,146
1 vote
1 answer
160 views

The examples below demonstrate what I want to achieve: /foo => /bar /foo/a => /bar/a /foo/a/b => /bar/a/b /foo/a/b/c => /bar/a/b/c ... I've tried <Redirect from="/foo/(.*)" ...
jddxf's user avatar
  • 2,020
0 votes
1 answer
303 views

I used express in a NodeJs project, and i want to be able to request my server with theses routes : /dogs /pinguin /bear /wolf /cat /rat I use a regex for this (http://forbeslindesay.github.io/...
LeDev's user avatar
  • 1
3 votes
2 answers
2k views

I have problem related to vue-router I need to exclude some group of words like: word1, some-word2, word3... from the router path { path: '/:pageIdenfifier(?!word1|some-word2|word3), name: '...
Evgen Matiola's user avatar
1 vote
1 answer
95 views

Path: /1,2,3,456,678 - only numbers and commas, not anything else Should be matched with regex-like path like this: /ids:(\\d+[,\\d]*) natively But https://www.npmjs.com/package/path-to-regexp in ...
Doc999tor's user avatar
  • 300
4 votes
0 answers
1k views

I'm trying to define a regex based dynamic path in Nuxt's serverMiddleware, but I'm not able to figure out how to achieve it because in the doc also there is no any mention about dynamic route. I want ...
Pratik149's user avatar
  • 1,117
0 votes
1 answer
1k views

Under the hood, I understand the vue-router uses path-to-regexp to handle route matching. If I use the route format: /app/:collection(/^cases$?)/:id This matches the route /app/cases/abc123 and ...
Tremendus Apps's user avatar
0 votes
1 answer
434 views

For some reason I can't get a float to work in vue router paths. /category/:category(\d+)/:post([-+]?([0-9]*\.[0-9]+|[0-9]+)) I've got numbers to work with :category(\d+) But for some reason a regex ...
user3410823's user avatar
0 votes
1 answer
621 views

Vue-Router uses https://github.com/pillarjs/path-to-regexp to convert paths to regular expressions. I have been trying to create an expression that matches an optional segment within an path but ...
Patrick's user avatar
  • 29
1 vote
1 answer
870 views

I've been trying to use react-router to define a series of nested components/routes w/ optional params, but also separated by path placeholders. i.e. /list /list/1 /list/items /list/1/items /list/1/...
RavenHursT's user avatar
  • 2,354