WIP
This commit is contained in:
parent
a49fac6cc8
commit
bb1e952e39
5 changed files with 4 additions and 5 deletions
|
|
@ -17,7 +17,6 @@ if (!httpOnly) {
|
|||
options.https = {
|
||||
key: fs.readFileSync(options.certKeyPath),
|
||||
cert: fs.readFileSync(options.certPath),
|
||||
requestCert: true
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Please configure your certificate.')
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ module.exports = function (options) {
|
|||
var authMiddleware
|
||||
|
||||
if (options.https) {
|
||||
var serverOptions = {
|
||||
const serverOptions = {
|
||||
key: options.https.key,
|
||||
cert: options.https.cert,
|
||||
requestCert: true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const pgp = require('pg-promise')()
|
||||
const psqlUrl = require('../lib/options').postgresql
|
||||
|
||||
module.exports = {db: pgp(psqlUrl)}
|
||||
module.exports = pgp(psqlUrl)
|
||||
|
|
|
|||
|
|
@ -261,7 +261,8 @@ exports.cartridgeCounts = function cartridgeCounts (deviceId) {
|
|||
return db.oneOrNone(sql, [deviceId, true])
|
||||
.then(row => {
|
||||
const counts = row ? [row.count1, row.count2] : [0, 0]
|
||||
return {id: row.id, counts: counts}
|
||||
const id = row ? row.id : 0
|
||||
return {id, counts}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ function buildBalances (deviceId) {
|
|||
}
|
||||
|
||||
function poll (req, res) {
|
||||
console.log('DEBUG1')
|
||||
const deviceId = getDeviceId(req)
|
||||
const deviceTime = getDeviceTime(req)
|
||||
const pid = req.query.pid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue