Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Node JS Create a Restful API for beginners JavaScript jQuery
Rating: 4.4 out of 5(54 ratings)
3,107 students

Node JS Create a Restful API for beginners JavaScript jQuery

For beginners learn to setup a Restful API that can send AJAX requests to the node server backend from jQuery frontend
Created byLaurence Svekis
Last updated 11/2024
English

What you'll learn

  • Setup and use NodeJS localhost
  • Add a SQLite database to a local project
  • Setup a simple Restful API

Course content

2 sections29 lectures2h 52m total length
  • Course Introduction9:28

    Learn how to build a restful API from scratch using Node and Express, handle get, post, put, and delete requests, and connect a front end with Ajax and jQuery.

  • Introduction to the Terminal CLI3:17
  • Node Package Manager4:23
  • Creating a Node project and start files2:19

    Create a node project and set up the main entry point with index.js, run node to see console output, and introduce basic variables, logging, and modules for future lessons.

  • explore Node modules5:19

    Explore how to create and import modules in node, export values with module.exports, and require them to build a modular node project.

  • Setup a localhost HTTP Localhost9:01

    Set up a localhost http server in Node using the http module, listen on port 3000, respond with hello world, and inspect request and response headers.

  • Read Files output Data4:56
  • Express and Nodemon3:52
  • API web resources Postman CRUD4:22
  • Body Parser npm4:28

    Install and configure body-parser middleware for express to parse incoming form data and json, run before routes, and access the parsed content via req.body in route handlers.

  • How Middleware app works3:13

    Learn how middleware runs before routes, using next to continue processing, access request body, and log messages to validate user credentials in a rest api.

  • Login CheckSetup4:21

    Build a login check simulation with an Express API, using a data object for admin, validating user and password via a post to login, and returning success or fail.

  • Create Public index file7:29

    Set up a public folder and static index page using Express static, and define basic user routes (get, post, get by id, put, delete) for a REST API.

  • Add Frontend JavaScript4:51

    Add frontend JavaScript and jQuery to wire up a clickable button, collect username and password, and prepare sending data to the back end for a simulated database.

  • Send Data from Front to Back6:57
  • Get Response data4:29
  • Restful API put and Delete6:30

    Learn to implement delete and put operations in a Node.js restful API by locating items by id, deleting with splice, and updating via request body in an in-memory data store.

  • Output Data to page4:02
  • Methods Delete and update Data10:39

    This lecture demonstrates connecting front-end routes to a Node JS API, enabling delete and update actions via AJAX, using event delegation for dynamic user items and data attributes for IDs.

  • Tweaks and Put Data8:40

    Learn how to implement a put workflow to edit list items, populate input fields from the selected item, and update data via ajax put with proper form submission.

  • Updates to Data2:41

    Generate unique ids by using date and Math.floor in the data object, then update routes to work with your database, build this REST API, and improve the front end.

  • Setup a helpers file code refactoring10:02

    Refactor a Node.js rest api by creating a helper directory, exporting data from a module, and moving core functions to the helper to clean up index.js.

  • Updates Styling and Tweaks10:39

    Enhance the user list interface with styling, inline inputs, and save, view, and delete actions via ajax, while hiding ids and keeping routes intact.

  • Add SQLite Database8:33

    Set up a SQLite database for your node app with npm, create a test database and users table, and perform insert, delete, update, and select.

  • Database to Frontend15:26

    Bring the database into the front end by wiring routes to perform select, insert, update, and delete operations on the users table, with results rendered in index.js.

  • Course code review and overview of application10:53
  • Resources0:21

Requirements

  • Beginner knowledge fundamentals of JavaScript jQuery HTML and CSS
  • Computer and terminal access

Description

Perfect course for beginners to explore how to setup a Restful API!  GET, POST, PUT, DELETE

This starter course demonstrates how to setup a Restful API from scratch.   Using just your local computer you can follow the step by step lessons to setup your own local server and run JavaScript code.   

JavaScript experience is required - This course is designed for students who want to learn about node.js and how to create projects with Node.  Its perfect for anyone who wants to practice coding by building out a simple web application.  Learn everything you need to setup a localhost, resources to work with node, setup a SQLite database, setup routes for CRUD and a whole lot more.

All the resources are provided along with source code to get you started quickly

Technology used within the course:

  • Front end AJAX requests will be using jQuery AJAX
  • Front end web page dynamic elements from JSON data using jQuery
  • HTML and CSS for presentation of front end application
  • NodeJS will be used for back end server
  • NPM packages include nodemon, express, bodyParser, sqlite3
  • Database is at the end using SQLite - SQLite setup files are included*
  • Editor Brackets Browser Chrome DevTools
  • JavaScript for everything else......

Lessons cover the following:

  • Explore how the terminal can be used to setup a backend server using Node.js.  Command line interface simple commands will be used to navigate and seutp folders.
  • Introduction to the Node Package Manager and how you can use it to get pre built code and bring it easily into your projects.
  • Create your start files and learn how you can run node.js files
  • explore Node modules and how they work into your main app file
  • Learn how to setup an http server using node ready for localhost
  • Explore getting file content and reading it as data
  • Power Up your node application with Express and Nodemon
  • API web resources Postman CRUD
  • Use Body Parser to get post data
  • Find out how Middleware app use works
  • Apply logic with conditional statement to create a login check 
  • Setup your application for static frontend files index.html
  • Get back to the frontend with JavaScript and html.  bringing both together
  • Requests and responses to the server and webpage
  • Setup your routes for a  Restful API GET POST PUT DELETE
  • Use data to output to page
  • Code refactoring with a helper file
  • Updating with adding a SQLite Database to hold data

Source code is included to get you started quickly

Step by step instruction, with friendly help always available in the Q&A section

Taught by an instructor with many years of web development experience, ready to help you learn

What are you waiting for join now and learn to setup your own RestFul API.

RESTful : Representational State Transfer (REST)  When HTTP is used, as is most common, the operations available are GET, POST, PUT, DELETE, and other predefined CRUD HTTP methods.


Who this course is for:

  • Anyone who wants to learn nodeJS
  • Anyone who wants to setup a local RestFul API
  • Anyone who wants to practice AJAX and APIs
  • Web developers
  • Junior programmers
  • Beginners to Node
  • JavaScript programmers who want to learn NodeJS