javascript - Testing REST routes with curl -X PUT, returns 404 -


i'm learning mean stack , following mean tutorial on @ thinkster.io https://thinkster.io/mean-stack-tutorial/

i'm on "opening rest routes" section. i'm trying put upvote using curl command:

curl -x put http://localhost:3000/posts/55387047f2334d2 c227e8079/upvote 

i following error messages:

c:\users\michael\desktop>curl -x put http://localhost:3000/posts/55387047f2334d2 c227e8079/upvote <h1>not found</h1> <h2>404</h2> <pre>error: not found     @ app.use.res.render.message (c:\users\michael\desktop\flapper-news\app.js: 39:13)     @ layer.handle [as handle_request] (c:\users\michael\desktop\flapper-news\n ode_modules\express\lib\router\layer.js:82:5)     @ trim_prefix (c:\users\michael\desktop\flapper-news\node_modules\express\l ib\router\index.js:302:13)     @ c:\users\michael\desktop\flapper-news\node_modules\express\lib\router\ind ex.js:270:7     @ function.proto.process_params (c:\users\michael\desktop\flapper-news\node _modules\express\lib\router\index.js:321:12)     @ next (c:\users\michael\desktop\flapper-news\node_modules\express\lib\rout er\index.js:261:10)     @ c:\users\michael\desktop\flapper-news\node_modules\express\lib\router\ind ex.js:603:15     @ next (c:\users\michael\desktop\flapper-news\node_modules\express\lib\rout er\index.js:246:14)     @ function.proto.handle (c:\users\michael\desktop\flapper-news\node_modules \express\lib\router\index.js:166:3)     @ router (c:\users\michael\desktop\flapper-news\node_modules\express\lib\ro uter\index.js:35:12)</pre> 

my mongoose schema defined module.exports=app in app.js i'm not sure else do. checked copy , pasting skills , there isn't typo.

restarting node server solved problem me


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -