Start over with 2.0.0

master
Jonatan Nilsson 2019-02-19 10:26:34 +00:00
parent e6d966bead
commit f17edde48f
8 changed files with 1 additions and 181 deletions

View File

@ -1,7 +0,0 @@
{
"presets": ["es2015-node5"],
"plugins": [
"syntax-async-generators",
"transform-async-to-generator"
]
}

33
.gitignore vendored
View File

@ -1,33 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
node_modules
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history

View File

@ -1,34 +0,0 @@
{
"eqeqeq": true,
"forin": true,
"immed": true,
"newcap": true,
"noarg": true,
"esnext": true,
"noempty": true,
"nonew": true,
"undef": true,
"unused": "vars",
"strict": true,
"trailing": true,
"noyield": true,
"indent": 2,
"module": true,
"quotmark": "single",
"maxdepth": 4,
"boss": true,
"eqnull": true,
"esversion": 6,
"globalstrict": true,
"smarttabs": true,
"browser": true,
"node": true,
"predef": [
"describe",
"it",
"before",
"beforeEach",
"after",
"afterEach"
]
}

0
dist/.gitkeep vendored
View File

View File

@ -1,2 +0,0 @@
require('babel-register');
require('./server');

View File

@ -1,6 +1,6 @@
{
"name": "nfp_moe",
"version": "1.0.0",
"version": "2.0.0",
"description": "NFP Moe website",
"main": "index.js",
"directories": {
@ -20,17 +20,7 @@
},
"homepage": "https://github.com/nfp-projects/nfp_moe",
"dependencies": {
"babel-plugin-syntax-async-generators": "^6.3.13",
"babel-plugin-transform-async-to-generator": "^6.4.6",
"babel-preset-es2015-node5": "^1.1.2",
"babel-register": "^6.4.3",
"bunyan": "^1.5.1",
"koa": "^2.0.0-alpha.3",
"koa-router": "^7.0.1",
"lodash": "^4.0.1",
"nconf": "^0.8.2"
},
"devDependencies": {
"nodemon": "^1.8.1"
}
}

View File

@ -1,83 +0,0 @@
import _ from 'lodash';
import nconf from 'nconf';
// Config follow the following priority check order:
// 1. Arguments
// 2. package.json
// 3. Enviroment variables
// 4. config/config.json
// 5. default settings
//Load arguments as highest priority
nconf.argv();
//Load package.json for name and such
var pckg = require('./package.json');
pckg = _.pick(pckg, ['name','version','description','author','license','homepage']);
//If we have global.it, there's a huge chance
//we're in test mode so we force node_env to be test.
if (typeof global.it === 'function') {
pckg.NODE_ENV = 'test';
}
//Load overrides as second priority
nconf.overrides(pckg);
//Load enviroment variables as third priority
nconf.env();
//Load any overrides from the appropriate config file
if (nconf.get('NODE_ENV') === 'test') {
//Load the config test file if we're in test mode
nconf.file('../config/config.test.json');
}
else {
//Otherwise load from config.json if it exists.
nconf.file('../config/config.json');
}
//Default variables for required database and other settings.
nconf.defaults({
NODE_ENV: 'development',
server: {
port: 3000,
host: '0.0.0.0',
url: 'http://localhost:3000'
},
frontend: {
url: 'http://localhost:3000'
},
bunyan: {
name: pckg.name,
streams: [{
stream: 'process.stdout',
level: 'debug'
}
]
},
jwt: {
secret: 'this-is-my-secret',
options: {
expiresIn: 60 * 24 * 7 * 60 //7 days
}
},
bcrypt: 5
});
module.exports = nconf;

View File

@ -1,11 +0,0 @@
import Koa from 'koa';
const app = new Koa();
// response
app.use(async (ctx) => {
ctx.body = 'Hello World';
});
app.listen(3000, () => console.log('server started 3000'));
export default app;