Skip to content

Commit

Permalink
Updated to deploy in heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulkrishh committed Mar 3, 2016
1 parent 522e66c commit 91bfcb2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
31 changes: 4 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
/node_modules
npm-debug.log
.DS_Store
/*.env
6 changes: 3 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("./serviceWorker.js") //Point to serviceWorker file
.then(function (registration) {
console.log("Service Worker is registered");
console.log("Service Worker is registered", registration);
document.getElementById("sw-register-state").textContent = "✓";

//To check support for push notifications
isPushNotification(registration);
})
.catch(function (error) {
console.error("Failed to register service worker");
console.error("Failed to register service worker", error);
document.getElementById("sw-register-state").textContent = "✕"; //Failed to register
});
}
Expand Down Expand Up @@ -131,7 +131,7 @@ function sendPushNotification(subscription) {
.then(function (subscription) {
curlCommand(subscription); //To log curl command in console

fetch("http://127.0.0.1:3000/send_notification", {
fetch("/send_notification", {
method: "post",
headers: {
"Accept": "application/json",
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "demo",
"description": "Demo - progress web application",
"version": "0.0.1",
"version": "1.0.0",
"author": "gokulkrishh",
"dependencies": {
"body-parser": "^1.15.0",
"express": "^4.13.4",
"node-gcm": "^0.14.0"
},
"engines": {
"node": "4.1.1"
},
"devDependencies": {},
"scripts": {
"start": "node server.js"
}
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ app.post("/send_notification", function (req, res) {
});
});

app.listen(3000, function() {
app.listen(process.env.PORT || 3000, function() {
console.log("Local Server : http://localhost:3000");
});

0 comments on commit 91bfcb2

Please sign in to comment.