0% found this document useful (0 votes)
59 views

Full Stack Development With Nodejs

Full stack development uses both frontend and backend code to connect a database to a client display. Node.js is a platform for server-side applications that uses JavaScript uniformly on both client and server sides. It allows for fast, scalable network applications through non-blocking event loops. This document outlines how to build full stack apps with Express and Dust templating on Node.js, connecting to a MySQL database through common functions like require(), app.use(), app.get(), and res.render().

Uploaded by

Noh Wan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Full Stack Development With Nodejs

Full stack development uses both frontend and backend code to connect a database to a client display. Node.js is a platform for server-side applications that uses JavaScript uniformly on both client and server sides. It allows for fast, scalable network applications through non-blocking event loops. This document outlines how to build full stack apps with Express and Dust templating on Node.js, connecting to a MySQL database through common functions like require(), app.use(), app.get(), and res.render().

Uploaded by

Noh Wan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Full Stack Development

With Node.js
DANIEL SEONG
What is full stack and Node.js?
◦ Both backend and frontend development
◦ Backend: Uses server-side code to connect to database
◦ Frontend: Uses client-side code to display to client
◦ Full stack connects the two!
◦ Node.js
◦ Open source platform for developing server side applications
Why use Node.js?
◦ JavaScript uniformity
◦ Client-side vs Server-side development
◦ Unifies language and data format (JSON)
◦ Fast, scalable network applications
◦ Single-thread vs multiple concurrent threads
◦ 2MB per thread, 8GB RAM gives 4,000 connections vs over 1M connections!
◦ Does this with non-blocking with event loop
◦ Example: messaging app that supports over 10,000 concurrent connections
◦ Node Package Manager (NPM)
Event Loop
What we will be using
◦ Express
◦ Framework that provides robust set of features for web applications
◦ Idea of middleware
◦ Allows to dynamically render HTML based on arguments passed to templates
◦ Dust
◦ JavaScript templating engine
◦ Way to build client side HTML pages with server-side arguments
◦ MySQL
◦ Can use MongoDB to complete JavaScript uniformity and increased flexibility
Schema
Common functions
◦ require()
◦ Load libraries and modules
◦ app.use([path,] callback [, callback...])
◦ Mounts specified middlware function at specified path
◦ app.set(name, value)
◦ Assigns setting “name” to “value”
◦ app.get(path, callback [, callback ...])
◦ Routes HTTP GET requests to specified path
◦ Think of GET requests as “getting” data from server
◦ res.render(view, [locals], callback)
◦ Returns rendered HTML of a view via callback

◦ Reference: https://expressjs.com/en/api.html
Recap
◦ Node.js
◦ Platform that allows you to make fast, scalable web applications
◦ Data
◦ You know how to get data from user, store in a database, retrieve it, and display to user
◦ This is just an introduction…
◦ Explore npm – some really cool libraries out there!
◦ Explore different frameworks
◦ Try building your own web application!

You might also like