Conteúdo do Curso
Backend Development with Node.js and Express.js
Backend Development with Node.js and Express.js
1. Introduction to Node.js and Backend Development
2. Building Console Applications with Node.js
Introduction to Console Applications in Node.jsWhat are Console Applications?Working with the File System in Node.jsChallenge: File System OperationsBuilding Command Line Interface (CLI) AppsUsing the Commander Module for CLI AppsWorking with the Readline ModuleBuilding a Guessing Game Console AppManaging Directories in Node.jsDirectory Inspection ToolSummary of Console Applications in Node.js
3. Developing Web Applications with Express.js
Introduction to Express.js in Web DevelopmentWhy Use Express.js for Web Development?Understanding HTTP RequestsSetting Up an Express.js ApplicationCreating and Managing Routes in Express.jsTesting APIs with PostmanIntroduction to Middleware in Express.jsUsing Built-in Middleware in Express.jsCreating Custom MiddlewareSummary of Key Express.js Concepts
4. Building REST APIs with Node.js and Express.js
Introduction to REST API DevelopmentCore Concepts of REST APIsSetting Up the Project StructureDefining the Entry Point of the APIBuilding the GET All Posts EndpointBuilding the GET Post by Id EndpointBuilding the CREATE Post EndpointBuilding the UPDATE Post by Id EndpointBuilding the DELETE Post by Id EndpointRunning and Testing the REST APIFinal Thoughts and Next Steps
Challenge: Build Your First Node App
🏆 Challenge
🎯 Goal
Prepare to begin a coding challenge to test your newfound knowledge of creating a simple Node.js application. The goal is to solidify your understanding of building a basic application using a single file and running it locally on the machine. This experience is crucial for your journey, as you'll frequently work locally in your development environment.
📋 Task
Create the Node.js application that calculates the total amount of money a user should pay for a given order. Here are the steps to complete the task:
- Start by opening a new project directory where you'll create a file named
app.js
. - Inside the
app.js
file, set three predefined variables:ordererQuantity
: The number of tumblers the user ordered;pricePerTumbler
: The price of a single tumbler;message
: The message to be logged in the console.
- Your main task is to calculate the total amount of money the user must pay for the order.
- Once you've calculated the total cost, use the
console.log()
function to display the message and the estimated total amount. - After writing the code, open your terminal and run the application.
- You should see the result in the console, displaying the total amount the user needs to pay.
// app.js const ordererQuantity = 4; const pricePerTumbler = 49; const message = "You have to pay:"; console.log(message, ___);
1. What is the price a user should pay?
2. What command must we use to run the app.js
file in the terminal?
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 6