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

Troubleshooting Node.js Express Server Routing Issue #5566

Closed
AlirezaEthDev opened this issue Mar 26, 2024 · 1 comment
Closed

Troubleshooting Node.js Express Server Routing Issue #5566

AlirezaEthDev opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@AlirezaEthDev
Copy link

I tried this simple code in NodeJS:

const express=require("express");

const app=express();

const accounts=[]

app.use("/dashboard",function(req,res,next){
    res.send(accounts);
    next();
})

app.post("/dashboard/add-account/:address{6}",function(req,res,next){
    accounts.push(req.params.address);
    console.info(accounts);
    next();
})

app.put("/modify-account/:index/:address{6}",function(req,res){
    accounts[req.params.index]=req.params.address;
    res.send(accounts);
})

app.delete("/dashboard/delete-account/:index[0-9]",function(req,res){
    accounts[req.params.index]="";
    console.info(accounts);
})

app.listen(3001,"127.0.0.1",650,()=>{console.info("Server is ready ...")});

By sending this request: http://localhost:3001/dashboard/add-account/0x1234

What should I do?

@wesleytodd
Copy link
Member

Hi, we dont provide technical support here. The repo is more for bugs and feature work. I would recommend asking this question on stackoverflow or reddit. Ideally with more details about the behavior you are seeing so that folks can properly help you debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants