Skip to content

Commit

Permalink
using console-files package, start checkout endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Nov 20, 2018
1 parent bc28b26 commit 347b0ba
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 68 deletions.
2 changes: 1 addition & 1 deletion bin/web.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// log on files
const logger = require('./../lib/Logger.js')
const logger = require('console-files')
// https://www.npmjs.com/package/rest-auto-router
const restAutoRouter = require('rest-auto-router')

Expand Down
42 changes: 0 additions & 42 deletions lib/Logger.js

This file was deleted.

23 changes: 3 additions & 20 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,9 @@
* @author E-Com Club
*/

process.on('uncaughtException', (err) => {
// fatal error
// log to file before exit
let msg = '\n[' + new Date().toString() + ']\n'
if (err) {
if (err.hasOwnProperty('stack')) {
msg += err.stack
} else if (err.hasOwnProperty('message')) {
msg += err.message
} else {
msg += err.toString()
}
msg += '\n'
}

let fs = require('fs')
fs.appendFile('/var/log/nodejs/_stderr', msg, () => {
process.exit(1)
})
})
// debug errors in files
// require logger module first of any code
require('console-files')

// web application
// recieve requests from Nginx by reverse proxy
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"rest-auto-router": "3.x",
"ajv": "5.x",
"ajv-i18n": "2.x",
"console-files": "2.x",
"axios": "0.x"
}
}
2 changes: 1 addition & 1 deletion routes/#modules.js → routes/#applications.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// log on files
const logger = require('./../lib/Logger.js')
const logger = require('console-files')

// JSON Schema validation with AJV
// based on http://json-schema.org/
Expand Down
12 changes: 12 additions & 0 deletions routes/@checkout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict'

// log on files
// const logger = require('console-files')

const GET = (id, meta, body, respond) => {
respond('Hello')
}

module.exports = {
GET
}
2 changes: 1 addition & 1 deletion routes/calculate_shipping.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// import common verbs (methods) functions
const httpVerbs = require('./#modules.js')
const httpVerbs = require('./#applications.js')
const modName = 'calculate_shipping'

const schema = {
Expand Down
2 changes: 1 addition & 1 deletion routes/create_transaction.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// import common verbs (methods) functions
const httpVerbs = require('./#modules.js')
const httpVerbs = require('./#applications.js')
const modName = 'create_transaction'

const schema = {
Expand Down
2 changes: 1 addition & 1 deletion routes/list_payments.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// import common verbs (methods) functions
const httpVerbs = require('./#modules.js')
const httpVerbs = require('./#applications.js')
const modName = 'list_payments'

const schema = {
Expand Down
2 changes: 1 addition & 1 deletion routes/page_loaded.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// import common verbs (methods) functions
const httpVerbs = require('./#modules.js')
const httpVerbs = require('./#applications.js')
const modName = 'page_loaded'

const schema = {
Expand Down

0 comments on commit 347b0ba

Please sign in to comment.