Skip to content

Commit

Permalink
fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
abedmurrar committed Jan 7, 2020
1 parent 057b306 commit 278e922
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
16 changes: 6 additions & 10 deletions bin/www.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Module dependencies. */
const app = require('../app');
const debug = require('debug')('bzu-wells-server-api:server');
const http = require('http');
const app = require('../app');

/* Get port from environment and store in Express. */
const port = normalizePort(process.env.PORT || '3000');
Expand Down Expand Up @@ -34,17 +34,15 @@ function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
const bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
console.error(`${bind} requires elevated privileges`);
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
console.error(`${bind} is already in use`);
process.exit(1);
break;
default:
Expand All @@ -55,8 +53,6 @@ function onError(error) {
/* Event listener for HTTP server "listening" event. */
function onListening() {
const addr = server.address();
const bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
const bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`;
debug(`Listening on ${bind}`);
}
8 changes: 5 additions & 3 deletions db/migrations/dev/20191113214149_readings_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ exports.up = knex => {
return knex.schema.hasTable(tableName).then(exists => {
if (!exists) {
return knex.schema.createTable(tableName, table => {
table.increments('id').primary().notNullable();
table
.increments('id')
.primary()
.notNullable();
table.float('reading').notNullable();
table.integer('height').notNullable();
table.float('volume', 6).notNullable();
Expand All @@ -18,7 +21,6 @@ exports.up = knex => {
.defaultTo(knex.raw('CURRENT_TIMESTAMP'));
table.boolean('is_active').defaultTo(true);


table
.foreign('well_id', 'idwells_idx')
.references('id')
Expand All @@ -27,7 +29,7 @@ exports.up = knex => {
.onUpdate('NO ACTION');
});
}
})
});
};

exports.down = knex => {
Expand Down

0 comments on commit 278e922

Please sign in to comment.