I am trying to find the solution to this error fro...
# help
s
I am trying to find the solution to this error from google but unfortunately could not. Please help.
s
You are creating two API routes that match the same condition
a different variable name does not make the route unique
s
@Seth Geoghegan it is working now. Thanks for helping. routes: { "GET /user/get-all": "src/userLambdas.getAll", "GET /user/get/{_id}": "src/userLambdas.getSingle", "POST /user": "src/userLambdas.createUserProfile", "PATCH /user/update-profile/{_id}": "src/userLambdas.updateProfile", "PATCH /user/update-settings/{_id}": "src/userLambdas.updateSettings", "DELETE /user/delete/{_id}": "src/userLambdas.deleteUser", },
s
Great! Glad it worked
Consider reading up on REST API design (also called RESTful design) when designing your API endpoints. For example, I'd suggest designing your API routes as follows:
Copy code
routes: {
                "GET /users": "src/userLambdas.getAll",
                "GET /user/{_id}": "src/userLambdas.getSingle",
                "POST /user": "src/userLambdas.createUserProfile",
                "PUT /user/{_id}/profile": "src/userLambdas.updateProfile",
                "PUT /user/{_id}/settings": "src/userLambdas.updateSettings",
                "DELETE /user/{_id}": "src/userLambdas.deleteUser",
            },
s
@Seth Geoghegan Thanks