Skip to content

Commit

Permalink
add template
Browse files Browse the repository at this point in the history
  • Loading branch information
CiccioTecchio committed Jan 19, 2019
1 parent 9d3612e commit 5c5d82c
Show file tree
Hide file tree
Showing 11 changed files with 3,325 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {}
},
"rules": {
"constructor-super": 2,
"for-direction": 2,
"getter-return": 2,
"no-case-declarations": 2,
"no-class-assign": 2,
"no-compare-neg-zero": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-fallthrough": 2,
"no-func-assign": 2,
"no-global-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-mixed-spaces-and-tabs": 2,
"no-new-symbol": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-self-assign": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-undef": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"no-unused-labels": 2,
"no-unused-vars": 2,
"no-useless-escape": 2,
"require-yield": 2,
"use-isnan": 2,
"valid-typeof": 2,
"comma-spacing": 2,
"global-require": 2,
"indent": 2,
"no-continue": 2,
"no-duplicate-imports": 2,
"no-empty-function": 2,
"no-var": 2,
"arrow-spacing": 2,
"camelcase": 2,
"semi": 2,
"no-undef-init": 2
},
"env": {
"node": true,
"mocha": true,
"jquery": true,
"es6": true,
"browser": true
}
}
17 changes: 17 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"all": true,
"cache": false,
"include": [
"**/routes/**.js"
],
"extensions": [
".js"
],
"report-dir": "./coverage",
"reporter": [
"html",
"text",
"text-summary"
],
"temp-directory": "./coverage/.nyc_output"
}
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js
node_js:
- "10"
cache:
directories:
- server/node_modules
script:
- npm test
- npm run lint
after_success:
- npm run coverage
after_failure:
- npm run coverage
23 changes: 23 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let express = require('express');
let path = require('path');
let cookieParser = require('cookie-parser');
let logger = require('morgan');
let ip = require('./credential/ip.json');
let indexRouter = require('./routes/index');

let app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', indexRouter);

let server = app.listen(ip.port, ip.address, function(){
let address = server.address().address;
let port = server.address().port;
console.log("Listening on " + address + ":" + port);
})
module.exports = app;
4 changes: 4 additions & 0 deletions credential/ip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "127.0.0.1",
"port": "3000"
}

0 comments on commit 5c5d82c

Please sign in to comment.