Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Now.sh Support
  • Loading branch information
ianvizarra committed Mar 31, 2020
commit f13b746d8f276a4fb3bdf4c3f4dfe5cc9d1490af
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.now
14 changes: 4 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ const express = require('express'),
util = require('./bin/util'),
fs = require('fs'),
axios = require('axios'),
covid19 = require('./lib/cli');

// set port
const port = process.env.port || 7070;

// package.json info
const pkg = JSON.parse(fs.readFileSync('package.json'));

// api base url
const apiBaseURL = "https://corona.lmao.ninja";
covid19 = require('./lib/cli'),
pkg = require('./package.json'), // package.json info
apiBaseURL= "https://corona.lmao.ninja", // api base url
port = process.env.port || 7070 // set port

// global route for covid19 tracker
app.get('/', async (req, res, next) => {
Expand Down
10 changes: 3 additions & 7 deletions lib/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable no-await-in-loop */

const color = require('ansi-styles'),
fs = require('fs'),
table3 = require('cli-table3'),
chart = require('./chart');
chart = require('./chart'),
pkg = require('../../package.json'), // package.json info
say = require('../sayings/threads.json') // sayings

// ansi colors
const
Expand All @@ -30,11 +31,6 @@ const
space = ' ',
br = '\n';


// package.json information
const pkg = JSON.parse(fs.readFileSync('package.json'));
const say = JSON.parse(fs.readFileSync('./lib/sayings/threads.json'));

// random sayings
const randomSay = () => {
let random = Math.floor(Math.random() * say.length);
Expand Down
19 changes: 19 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 2,
"builds": [{
"src": "app.js",
"use": "@now/node-server"
}],
"routes": [{
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, Content-Type, Accept"
},
"src": "/.*",
"dest": "/app.js"
}],
"env": {
"VERSION": "1"
}
}