Codecademy's Learn Express, Writing Your First Route

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=uYjwnj5W-Lk



Duration: 5:08
160 views
5


In this Express JS lesson from Codecademy, we look at how to go about writing your first route. The route we write will take a path and a call back function. The path, we learn, comes after the host and the port. The route of the home page is usually a '/' and this would be equivalent to going to 'anypage.com/'. An about page could usually be found at the 'anypage.com/about'. So the route we create can return data (or respond) to the client that requests the specific route. In this challenge we are asked to create a route called '/expressions' . Once someone hits that route (in other words, navigates their from their browser'), we then console.log the request object which has information the server responds with. **** app.use(express.static("public")); is what allows for our express yourself machine to display once the server is started. The 'public' folder is made visible to our app when we start our server because of 'app.use(express.static()); We specifically want to use the assets within the public folder. ****




Other Videos By We Will Code


2018-07-09Question App in Nodejs, Pug,cookie-parser, setting cookies 5
2018-06-29Question App in Nodejs, Pug, Body-Parser Parsing Form Data 4
2018-06-27Question App in Nodejs, Pug, Express, Include Partials 3
2018-06-26Question App in Nodejs, Pug, Express, Rendering Response 2
2018-06-25Question App in Nodejs, Express, Flash Card App with Pug Templating
2018-06-22Codecademy's Learn Express, Matching Longer Paths, ExpressJS
2018-06-21Codecademy's Learn Express, Setting Status Codes
2018-06-19Codecademy's Learn Express, Getting a Single Expression
2018-06-18Codecademy's Learn Express, Matching Route Paths, Understanding Express JS
2018-06-15Codecademy's Learn Express, Sending a Response, Nodejs Backend
2018-06-14Codecademy's Learn Express, Writing Your First Route
2018-06-13Codecademy's Learn Express, Starting a Server, Back-End Apps
2018-06-13Learn Express JS, Back-End Programming Tutorial, Codecademy
2018-06-09Crypto Zombies Lesson 2, Chapter 8, Zombie DNA, Solidity DApp
2018-06-03Crypto Zombies Lesson 2, Chapter 7, Storage vs Memory
2018-06-01Crypto Zombies Lesson 2, Chapter 6, Import, Imports in Solidity
2018-05-27An Intro to Coding, Codecademy's Welcome To Codecademy Tutorial, Codecademy Starter Kit
2018-05-13Crypto Zombies Lesson 2, Chapter 5, Inheritance, Solidity Walkthrough
2018-05-11Crypto Zombies Lesson 2, Chapter 4, Require, Solidity Require Statements
2018-05-10Crypto Zombies Lesson 2, Chapter 3 Msg.sender, Solidity Language
2018-05-06Crypto Zombies Lesson 2, Chapter 2 Mappings and Addresses



Tags:
Express tutorial
learning express
express js
express routes
writing routes in express
nodejs