Skip to content

Commit 516e68e

Browse files
Adding the first version of the advance react app
0 parents  commit 516e68e

File tree

8 files changed

+6695
-0
lines changed

8 files changed

+6695
-0
lines changed

.eslintrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
env: {
4+
browser: true,
5+
commonjs: true,
6+
es6: true,
7+
node: true,
8+
jest: true,
9+
},
10+
extends: ['eslint:recommended', 'plugin:react/recommended'],
11+
parserOptions: {
12+
ecmaFeatures: {
13+
experimentalObjectRestSpread: true,
14+
jsx: true,
15+
},
16+
sourceType: 'module',
17+
},
18+
plugins: ['react'],
19+
rules: {
20+
'react/prop-types': ['off'],
21+
'linebreak-style': ['error', 'unix'],
22+
quotes: ['error', 'single'],
23+
semi: ['error', 'always'],
24+
'no-console': ['warn', { allow: ['info', 'error'] }],
25+
'arrow-parens': ['error', 'always'],
26+
},
27+
};

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules
31+
jspm_packages
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional REPL history
37+
.node_repl_history
38+
39+
#Webstorm
40+
.idea
41+
.DS_Store
42+
43+
#prod build
44+
dist

lib/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports={
2+
port: process.env.PORT || 8080,
3+
};

lib/server.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
import express from 'express';
3+
import config from './config';
4+
5+
const app= express();
6+
7+
//anything we server here will be served directly
8+
app.use(express.static('public'));
9+
10+
//Configuring express to use EJS as it's template language
11+
app.set('view engine', 'ejs');
12+
13+
app.get('/', (req,res)=> {res.render('index', {answer : 42});});
14+
15+
app.listen(config.port, function listenHandler(){
16+
console.info(`Running on ${config.port}`);
17+
});

0 commit comments

Comments
 (0)