0

My Id's in my name database look like this "Users/123"

My api has an endpoint to load data like this "api/user/Id"

But because of my the way the Id's are created with the slash, I'm getting 404 trying to hit "api/user/Users/123"

Anyway I can get Javascript / axois to play nice here?

Luke
  • 59
  • 1
  • 6

1 Answers1

0

Check out this issue Dealing with slash characters in request parameter using Express route.

Another thing you could do is split the request. So you would have "api/user/:type/:id" and in your api concatenate the params with a slash.

Let me know if this helps!

Daan
  • 116
  • 5