Introduction
Hello! The purpose of this document is to guide you on how to set up a static Node.js web application using Express.js version 4.17.2 that works for both Mac and Windows machines. We will divide the fundamentals of how the software works into smaller building blocks that form the basic structure of complex projects.
Express.js is one of the most popular Node.js back-end web application frameworks that was released as a free and open-source software. It provides many useful features to provide server-side logic for web and mobile applications in a simple and flexible way. It also improves the development work flow for faster back end set-up and easier front-end integration.
Intended Users
Regardless of where you are in your development journey, this documentation will provide clear guidance on the basic concepts of Express.js. This guide will be particularly useful for:
- Beginner developers that have basic front-end and back-end knowledge.
- Development teams that want to save time on back-end set up.
Software Versions
Please have the following installed before proceeding:
- Node.js version 14.17.6 or later
- Visual Studio Code
- Npm Package manager version 6 or later
Prerequisites
This document requires the following knowledge:
- Working knowledge of the Visual Studio Code terminal
- Basic knowledge of Javascript(ES6), HTML, and CSS to create a static web page
- Working knowledge of the Node.js package manager npm
Procedures Overview
By the end of this guide, you will understand:
- How to install Express.js
- How the file structure is organized
- How to display messages to the browser
- How to do basic routing methods
- How to use middleware to display static files
Typographical Conventions
This document adheres to the following typographic conventions:
Convention | Typeface | Examples |
---|---|---|
Terminal commands and code | Light code | npm init , npm install |
Keystrokes | [Bold Brackets] | [CTRL], [~] |
Console Output | Light Italic Code | internal/modules/ejs |
Key terms and files | Italic | routing, port |
Folder navigation | ‘Light’ | ‘folder name’ |
💭 NOTE: This is a note icon that suggests to pay attention to the following information.
❗ CAUTION: This is a caution icon that suggests to be careful proceeding with the folowing steps.
🚨 DANGER: This is a danger icon that suggests actions that will cause the software to crash.
Conclusion
Express.js is a straightforward Node.js framework that can help developers code more efficiently, and is a cost effective option for businesses. Its ease of use makes it adoptable for beginners, and the various middlewares available allows for flexibility to project needs.
That being said, let’s get started with Express!