restfulapitutorial's People
Forkers
seong88 codenamejason gnanasekharjava shivanandacss foxhound7812 kenken64 dollys21 mahendramahi nicnash joseantoniomanjarres wanjarus avasni tmnvvv cidarm leaflyflyfly upendra117 bambrozio stackriot djkwagala ththth0303 neonsec nlgrf amandankosiyane aydenrennaker redanium aeristhy tssaint anki1611 vikasisme lylaie hitamashi radhanathdas harhogefoo ivonakov khaled-ansary oomatz pablohmoha hellange sreevassb agoodman42 wanedenis demesew sabiacademy vignesh-krish jovaz21 brunorafaei xskillzx tulaneadam joserfjuniorllms alexandreyembo thushankavishka bouyagas tbiancoar parmarkaushik15 hendrigeekseat mcohen30 cabarini behnamgh siddhantsrivastava md-hiccup pablodmv ozkanada govindsharma7 fkesheh rohitshukla92 anurag-majumdar xin00163 loraxx753 kikeex yasharne richardmwaba santhuuu0007 nitinsinghit kuldeeptyagi83 thommedia rohitsahu21 dilankadon shoulderapps saitejareddy07 gustavious smintexas tareque20 saizprua tshiamor-adft jwritescode chameerad malick7 ksankumar mnemosynemei junaidbasit nagramachandran mehdydriouech dantecalderon rupesh2010 precdleyson achouhan93 veensy rohubert godjackhoo marceluphdrestfulapitutorial's Issues
Should delete req.body._id before update mongodb
Should delete req.body._id before update mongodb, otherwise it will false.
Error: data and salt arguments required
After cloned the project I've updated according to new mongoose version by adding **'useMongoClient : true'**
. And the project is running ok.
When I send 'localhost:3000/auth/register' POST request via postman I'm getting this error. Is it a bug ? Or what have I done wrong ?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Error: data and salt arguments required
<br> at Object.hashSync (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/bcrypt/bcrypt.js:71:15)
<br> at exports.register (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/api/controllers/userController.js:9:34)
<br> at Layer.handle [as handle_request] (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/layer.js:95:5)
<br> at next (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/route.js:137:13)
<br> at Route.dispatch (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/route.js:112:3)
<br> at Layer.handle [as handle_request] (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/layer.js:95:5)
<br> at /home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:281:22
<br> at Function.process_params (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:335:12)
<br> at next (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:275:10)
<br> at jsonParser (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/body-parser/lib/types/json.js:112:7)
<br> at Layer.handle [as handle_request] (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/layer.js:95:5)
<br> at trim_prefix (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:317:13)
<br> at /home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:284:7
<br> at Function.process_params (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:335:12)
<br> at next (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/express/lib/router/index.js:275:10)
<br> at urlencodedParser (/home/pankaja/Projects/Nodejs/Tutorial/todoApp/RESTfulAPITutorial/node_modules/body-parser/lib/types/urlencoded.js:100:7)
</pre>
</body>
</html>
Not working in deployment site. Just working locally.
Deployment
How we can deploy the project rather than copy the entire project. Is there any way to bundle the application same as Angular.
email registration feild not found
when i run the application ,in http://localhost:3000 im getting reset password form ,im not able to find the page in which i can register the mail id in database
Mongo Error?
Doesn't work
# git clone https://github.com/generalgmt/RESTfulAPITutorial.git && cd RESTfulAPITutorial
# npm install
# npm run start
> [email protected] start /home/px/src/RESTfulAPITutorial
> nodemon server.js
[nodemon] 1.17.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
todo list RESTful API server started on: 3000
In the JS console:
Content Security Policy: Couldn't process unknown directive 'report-to'
http://localhost:3000/tasks doesn't respond ; the loading icon keeps spinning ; Oh well, 10 (more like 25) minutes down the drain :)
PS - just to be sure, I tried running it with pm2 ; no luck :(
npm run start issue
todo list RESTful API server started on: 3000
(node:22876) DeprecationWarning: open()
is deprecated in mongoose >= 4.11.0, use openUri()
instead, or set the useMongoClient
option if using connect()
or createConnection()
. See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client
events.js:160
throw er; // Unhandled 'error' event
^
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (/root/jwt/RESTfulAPITutorial/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:188:7)
at Connection. (/root/jwt/RESTfulAPITutorial/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Connection.g (events.js:292:16)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:191:7)
at Socket. (/root/jwt/RESTfulAPITutorial/node_modules/mongodb-core/lib/connection/connection.js:189:49)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1281:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
[nodemon] app crashed - waiting for file changes before starting...
Mongoose error
When I run the server it throw's me this error:
/opt/lampp/htdocs/RESTfulAPITutorial/node_modules/mongoose/lib/connection.js:309
var promise = new Promise.ES6(function(resolve, reject) {
^
TypeError: undefined is not a function
at NativeConnection.Connection.open (/opt/lampp/htdocs/RESTfulAPITutorial/node_modules/mongoose/lib/connection.js:309:17)
at Mongoose.connect (/opt/lampp/htdocs/RESTfulAPITutorial/node_modules/mongoose/lib/index.js:242:47)
at Object. (/opt/lampp/htdocs/RESTfulAPITutorial/server.js:9:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
[nodemon] app crashed - waiting for file changes before starting...
Ths !
Bug in document update
todoListController is using findOneAndUpdate to update mongo document, The result is that it updates the first entry in the collection, no-matter the passed taskId value.
The solution is to use findByIdAndUpdate instead of findOneAndUpdate.
You might also add res.status(400) before res.send(err);
Error on nodemon
Seems like there is a code that must be changed or upgrade
npm run start
> [email protected] start /home/putrapc/webproject/RESTfulAPITutorial
> nodemon server.js
[nodemon] 1.17.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
todo list RESTful API server started on: 3000
(node:22613) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client
events.js:183
throw er; // Unhandled 'error' event
^
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (/home/putrapc/webproject/RESTfulAPITutorial/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection.<anonymous> (/home/putrapc/webproject/RESTfulAPITutorial/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket.<anonymous> (/home/putrapc/webproject/RESTfulAPITutorial/node_modules/mongodb-core/lib/connection/connection.js:189:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
[nodemon] app crashed - waiting for file changes before starting...
Where do you get _id?
RESTfulAPITutorial/test/todos.test.js
Line 42 in de3bdf9
There is no _id in task variable. How does it work?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.