A smaller and simpler project than the last two, almost a break! This is one of a few simpler projects for you to get some practice working on basic node apps from start to finish.
- Debugging Node apps in VSC
- Using
npm
: installing dependencies, running scripts - Understanding what "fullstack" means
- Using branches
- Reading and writing from the File System
- Correctly using Sync & Async file system manipulations
- Writing Express routes with different verbs and URL parameters
- Using Async/Await to write more readable code
- Navigating larger directory structures
- Understanding code you didn't write
- Setting up and running other people's projects
- Contributing to existing code bases
- Explaining why you can't run an API with the browser
- Running API's with Node.js & VSC
- Testing API's with Postman
- Understanding the need for CORS
- URL Request Parameters
- Sending values in the Request Body
Before you can get started writing your routes you'll want to make sure all dependencies are installed.
Step 0 is to clone this repo. Then you can move on to ...
npm install
npm run dev
- (this project has no frontend, use Postman for testing)
npm run test
ornode test
In ./logic/index.js
write the function described by the tests in ./test
.
The file ./logic/sandbox.js
is there for you to experiment and debug your function.
In the file ./cli.js
write a script that allows a user to use your logic function from the command line. There is are more detailed instructions in the file itself.
Write the routes described in ./server.js
. When your API works, a user can
- get a list of of all files in
./files
- add a new file to the directory
- use your logic function to update the files in
./files
- get the latest test report
Debugging JS Servers In VSC
- VSC Debugger (from the docs)
- Debugging Node apps (from the docs)
- Express in VSC (video)
- Express in VSC (another video)
Node.js Tutorials
These tutorials will introduce you to a bunch of new features in Node that you haven't seen in the Browser. While you're following these tutorials, it's important to remember that at it's core Node.js is still JavaScript. Everything you've learned so far (except for the DOM & fetch
:) is still true! The Event Loop, Classes, Closure, Arrays, Objects, Variables, this.
, it's all still the same.
The tutorials below will introduce to what's new and what's special about Node. But don't forget to take some time and solve a few of the JavaScript Exercises above to get used to working with plain, vanilla JS in the terminal.
fs: Synchronous & Async
- promises: FunFunFunction
- async/await: FunFunFunction
- fs: TechSith video
- fs: Net Ninja video
- fs, async vs. sync: Eduonix
- fs, async vs. sync: Kharbanda
API's and Express
Node.js is a JavaScript runtime environment capable of writing Web Servers and API's all by itself. But it's a bit annoying. Express is a great and easy to use framework to help you write API's and Web Servers by handling all of the boring stuff for you so you can focus on what your app does.
Postman - an app for testing your API's without using a browser.