#Backend Node
You'll be able to backend dev.
You already know javascript. Now it's time to backend it up.
Node is a javascript environment which runs outside the browser, instead it runs on the command line. The technologies you already know are linked heavily to node:
Came from Node in the first place:
- npm
- requiring modules
Work fine with Node:
- Babel (and hence es6 / es7)
- eslint
- Any npm package
Don't work / can't be used with Node:
- Webpack (webpack, kind of simulates node (deals with requiring things))
There are some things you can do in node that you can't do inside a browser:
- Access things your operating system knows about
- local filesystem
- running processes
- launch a program
- anything you can do on a command line
- Communicate over protocols other than http / websockets / webRTC (which are the only things you can do in a browser)
- Run a http backend
There are lots of npm packages to help you with all of this stuff. We'll run through a few now.
- File System API
- Express http server.
- Get our node-seed up and running.
- Create a new directory on the filesystem
- Create a file called hello.txt which contains the text: 'hello'
- Make a HTTP get service which returns "hello" using Express
- Make a HTTP get service which returns the JSON
{"hello": "<name>"}and takes a paramname="john". - Make a HTTP post service which takes JSON {"hello": "john"} and returns that same json.
- Redo the lodash task in node