File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules /
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments