Skip to content

Commit

Permalink
linting & env setting
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessayuenn committed Jan 24, 2018
1 parent e52ffa1 commit 1549310
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.env
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"start": "node server.js"
},
"dependencies": {
"dotenv": "^4.0.0",
"express": "^4.16.2",
"standard": "^10.0.3",
"the-noun-project": "^2.0.1"
Expand Down
7 changes: 4 additions & 3 deletions public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const app = new Vue({
data: {
icon: {},
iconNext: {},
msg: '',
started: false,
score: 0,
time: 180,
Expand All @@ -26,12 +27,12 @@ const app = new Vue({

fetchIcon: function () {
return fetch('/icon')
.then((data) => data.json())
.then((data) => {
.then((data) => data.json())
.then((data) => {
let { term, preview_url } = data.icon
term = term.trim()
return { term, preview_url }
})
})
},

checkKey: function (e) {
Expand Down
4 changes: 3 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('dotenv').config()

const express = require('express')
const path = require('path')
const NounProject = require('the-noun-project')
Expand Down Expand Up @@ -34,6 +36,6 @@ app.get('/icon', (req, res) => {
handler(0)
})

const listener = app.listen(process.env.PORT, () => {
const listener = app.listen(process.env.PORT || 3000, () => {
console.log(`Your app is listening on port ${listener.address().port}`)
})

0 comments on commit 1549310

Please sign in to comment.