Skip to content

Commit 58b1dfd

Browse files
committed
Step 1: Initialise your App
0 parents  commit 58b1dfd

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# React 1.0: Basic React App
2+
3+
## Step 1: Initialise your App
4+
5+
npm init
6+
npm install --save express
7+
8+
After installing the dependencies, create a new file **server.js** in your root directory.
9+
10+
**server.js**
11+
12+
const express = require("express");
13+
const app = express();
14+
15+
app.listen(3000, function() {
16+
console.log("Listening on port 3000")
17+
});
18+

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "react-basic-setup",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"express": "^4.15.3"
13+
}
14+
}

server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const express = require("express");
2+
const app = express();
3+
4+
app.use ( express.static("static/") );
5+
6+
app.listen(3000, function() {
7+
console.log("Listening on port 3000")
8+
});

0 commit comments

Comments
 (0)