Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter Routes do not work with live-server #427

Open
jebarpg opened this issue Jan 15, 2024 · 0 comments
Open

Parameter Routes do not work with live-server #427

jebarpg opened this issue Jan 15, 2024 · 0 comments

Comments

@jebarpg
Copy link

jebarpg commented Jan 15, 2024

Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting

Issue description

using
live-server /public
then opening
http://127.0.0.1:8080/user/1
returns a GET /user/1 404 error

using node.js code

server.js

    var express = require('express');
    var app = express();
      
    app.get('/user/:id', function(request, response){
       var id = request.params.id;
       response.send("User id is " + id);
    });
      
    app.listen(3000, () => console.log(`App listening on port 3000`))

run
node server.js
then in different terminal same directory run
live-server
http://127.0.0.1:8080/user/1 does not work
http://127.0.0.1:3000/user/1 works

Software details

  • Command line used for launching live-server:
  • OS:
  • Browser (if browser related):
  • Node.js version:
  • live-server version:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant