/simpleAPI

Node.js REST API's with CRUD operations

Primary LanguageJavaScript

simpleAPI

Just testing out how API's and node.js

/ez - Very simple API with GET, PUT, POST, and DELETE functionalities on static data

/harder - API connected to a DB (mongo)

/reactAPI - React app that uses a REST API

npm install

node modules used

express | body-parser| mongoose

Helpful web dev tools

React Notes

Setting up a react project

Setup all the tools react needs globally

npm install -g create-react-app

Create a react project

create-react-app <project name>

cd <project name>

Start project and loads local server

npm start

Node.js Notes

What is Node.js

Node.js is a javascript runtime built on Chrome's V8 *JavaScript engine*. Which means that it is a standalone javascript server, not having to run on client side.

NPM

Start a npm project that will add the package.json
npm init

How to properly pull in a node module
npm install --save moduleName
This will download and add this module to your node_modules folder and the dependency. A benefit to this is that if someone is trying to import all the node modules for a project they can simply run

Popular Modules
Express - Web development framework
Connect - HTTP server framework
Socket.io - Server side component for websockets
Pug/Jade - Template engine inspired by HAML
Coffee-Script - CoffeeScript compiler
Redis - Redis client library

Express Notes

Express is a web framework for Node.js used to build web applications and API's. It uses MVC concepts
  • M odel - The actual data. Database's, data storage..
  • V iew - Displaying the user interface. What the user see's
  • C ontroller - Direct traffic, route, load views..