aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-06-01 23:26:18 -0700
committerAdam Soltys <[email protected]>2021-06-09 16:07:17 -0700
commit2873f6901eaed83824aa0bb4c33c77268bb941b3 (patch)
tree94429d044ce44360bba5680e52358e7fc8b931fd
parent386a3e099a1d8169a722549e1db0b71054ea06e8 (diff)
downloadcoinos-server-2873f6901eaed83824aa0bb4c33c77268bb941b3.tar.gz
coinos-server-2873f6901eaed83824aa0bb4c33c77268bb941b3.zip
remove pino from start command
-rw-r--r--index.js6
-rw-r--r--lib/rates.js3
-rw-r--r--package.json2
3 files changed, 9 insertions, 2 deletions
diff --git a/index.js b/index.js
index 6796dbe7..563572f7 100644
--- a/index.js
+++ b/index.js
@@ -111,3 +111,9 @@ app.use((err, req, res, next) => {
server.listen(config.port, () =>
console.log(`CoinOS Server listening on port ${config.port}`)
);
+
+process.on("SIGINT", process.exit);
+
+process.on('uncaughtException', function (exception) {
+ console.log(exception);
+});
diff --git a/lib/rates.js b/lib/rates.js
index 80c22bf0..598fc041 100644
--- a/lib/rates.js
+++ b/lib/rates.js
@@ -9,7 +9,7 @@ let fetchRates;
try {
({ date, fx } = JSON.parse(fs.readFileSync("fx")));
- } catch {
+ } catch(e) {
l.warn("Failed to read fx file");
}
@@ -30,6 +30,7 @@ let fetchRates;
} = await axios.get(
`http://data.fixer.io/api/latest?access_key=${config.fixer}`
);
+
let USD = fx["USD"];
Object.keys(fx).map(k => {
fx[k] = parseFloat((fx[k] / fx["USD"]).toFixed(6));
diff --git a/package.json b/package.json
index 83b42afa..4c7050b9 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
- "start": "nodemon index.js | pino-pretty",
+ "start": "nodemon index.js",
"generate": "sequelize-automate -c config/index.js"
},
"dependencies": {