Many changes

- Express -> Koa
- Babel for transforming 'import' into 'require'
- SQL done for adding request; just need to get the app to call it
This commit is contained in:
Daniel J. Summers
2017-09-19 22:20:17 -05:00
parent 270ac45e8c
commit 794a365f08
12 changed files with 1179 additions and 293 deletions

22
src/api/app.js Normal file
View File

@@ -0,0 +1,22 @@
'use strict'
const chalk = require('chalk')
const env = process.env.NODE_ENV || 'dev'
if ('dev' === env) require('babel-register')
const fullEnv = ('dev' === env) ? 'Development' : 'Production'
/** Configuration for the application */
const appConfig = require('./appsettings.json')
/** Express app */
const app = require('./index').default
// Ensure the database exists...
require('./db').default.verify().then(() =>
// ...and start it up!
app.listen(appConfig.port, () => {
console.log(chalk`{reset myPrayerJournal | Port: {bold ${appConfig.port}} | Mode: {bold ${fullEnv}}}`)
}))