Skip to content

Commit

Permalink
Adjusts script and Heroku Procfile
Browse files Browse the repository at this point in the history
Should work with heroku now
  • Loading branch information
vmarchesin committed Mar 21, 2018
1 parent 66ca4ab commit cff7af2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: npm start
1 change: 0 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const specificTokens = tokens.specificTokens
Array.prototype.choices = function(n) {
let choices = []

console.log(this)
for (let i = 0; i < n; i++) {
choices.push(this[Math.floor(Math.random() * this.length)])
}
Expand Down
7 changes: 4 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require("express")
const fs = require("fs")
const api = require("./api/index.js")
const api = require(`${__dirname}/api`)
const bodyParser = require("body-parser")
const version = fs.readFileSync(`${__dirname}/api/VERSION`, "utf-8")

Expand All @@ -25,6 +25,7 @@ app.post(`/api/${version}`, (req, res) => {
res.send(response)
})

app.listen(3000, function () {
console.log("Zapinating on port 3000!")
const port = process.env.PORT || 8080
app.listen(port, function () {
console.log(`Zapinating on port ${port}!`)
})
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
"description": "Vem de zap bb",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "node app.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/MarEe0/zapinator.git"
"url": "git+https://github.com/vmarchesin/vemdezapbe.be.git"
},
"author": "Vinicius Marchesin Araujo",
"license": "ISC",
"bugs": {
"url": "https://github.com/MarEe0/zapinator/issues"
"url": "https://github.com/vmarchesin/vemdezapbe.be/issues"
},
"homepage": "https://github.com/MarEe0/zapinator#readme",
"homepage": "https://github.com/vmarchesin/vemdezapbe.be#readme",
"dependencies": {
"body-parser": "^1.18.2",
"express": "^4.16.3"
Expand Down

0 comments on commit cff7af2

Please sign in to comment.