Code Monkey home page Code Monkey logo

node-api's Introduction

Building a RESTful API in Node and Express

Using the new Express 4.0 Router to build an API

Read the tutorial

Requirements

  • Node and npm

Installation

  • Clone the repo: git clone [email protected]:scotch-io/node-api
  • Install dependencies: npm install
  • Start the server: node server.js

Testing the API

Test your API using Postman

node-api's People

Contributors

electronharvester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-api's Issues

Unable to post using Postman

When I send post with the http://localhost:8080/api/bears the following error occurs:
image

I can't figure out the problem.

MongoError: auth fails

can't run node server.js as it gives me the following error.

node-api/node_modules/mongoose/node_modules/mongodb/lib/utils.js:99
    process.nextTick(function() { throw err; });
                                  ^
MongoError: auth fails
    at Function.MongoError.create (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:31:11)
    at /Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:483:72
    at authenticateStragglers (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:429:16)
    at Connection.messageHandler (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:463:5)
    at Socket.<anonymous> (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:309:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:543:20)

saving names

Hello, Thanks for the tutorial, such a bug a fan of scotch(io). When I'm running the tutorial (and even running the cloned repo here [with no changes] the name of the Bear will not save, and whenever I get all the bears they just have _id and __v properties, is there an update that changed the way we should write the creating post? thanks!

A little question

When I have lots of routes to config, how to manage these routes in a anther file(files)?
And What I should include the routes file in the server.js?

I'm a rookie.

Thank you.

Error is throwing to Mongo DB. I am new to JS and NodeJS framework. Can you please tell me the possible solution.

webonise@webonise-desktop:~/JavaScriptProjects/node-api$ node server.js
Magic happens on port 8080

/home/webonise/JavaScriptProjects/node-api/node_modules/mongodb/lib/utils.js:99
process.nextTick(function() { throw err; });
^
MongoError: auth fails
at Function.MongoError.create (/home/webonise/JavaScriptProjects/node-api/node_modules/mongodb-core/lib/error.js:31:11)
at /home/webonise/JavaScriptProjects/node-api/node_modules/mongodb-core/lib/connection/pool.js:483:72
at authenticateStragglers (/home/webonise/JavaScriptProjects/node-api/node_modules/mongodb-core/lib/connection/pool.js:429:16)
at Connection.messageHandler (/home/webonise/JavaScriptProjects/node-api/node_modules/mongodb-core/lib/connection/pool.js:463:5)
at Socket. (/home/webonise/JavaScriptProjects/node-api/node_modules/mongodb-core/lib/connection/connection.js:309:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
webonise@webonise-desktop:~/JavaScriptProjects/node-api$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.