adamd / express-server Goto Github PK
View Code? Open in Web Editor NEWA quick intro to Node and Express
Home Page: https://lab.github.com/everydeveloper/introduction-to-node-and-express
A quick intro to Node and Express
Home Page: https://lab.github.com/everydeveloper/introduction-to-node-and-express
First, let’s install Node.js
We will be using an app called PostMan to test our API.
Node.js comes with something called NPM (Node Package Manager), that we will use manage our node modules. After the install is complete, check that you have both Node.js and NPM by running these commands in your terminal:
node -v
npm -v
You should get a version back from each of these commands, if it was correctly installed.
OK, now let’s create a folder and add some initial files by entering these commands in the terminal:
mkdir node-project
cd node-project
touch server.js middleware.js .gitignore
Next, we will initialize a package.json file, which will allow us to install and save node modules:
npm init -y
git init
Before we go any further, let’s add this line to our .gitignore
file so we don’t track our node_modules
if we are using git:
/node_modules
Alright, now we can install Express using npm. Enter this command in the terminal:npm install express --save
With that, your basic environment is set up. Check that you have these files:
-middleware.js
-node_modules
-.gitignore
-package-lock.json
-package.json
-server.js
Open your package.json file and make sure you have something like this under your dependencies:
"dependencies": {
"express": "^4.17.1",
}
The number on the right is the version you downloaded. Since we aren’t tracking the actual node_modules
folder, this section is a reference used to re-install the modules your application depends on.
When you've finished, close this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.