Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

updated node version #116

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

41 changes: 4 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
# node-js-sample
# node-hello

A barebones Node.js app using [Express 4](http://expressjs.com/).

## Running Locally

Make sure you have [Node.js](http://nodejs.org/) and the [Heroku Toolbelt](https://toolbelt.heroku.com/) installed.

```sh
git clone [email protected]:heroku/node-js-sample.git # or clone your own fork
cd node-js-sample
npm install
npm start
```

Your app should now be running on [localhost:5000](http://localhost:5000/).

## Deploying to Heroku

```
heroku create
git push heroku master
heroku open
```

Alternatively, you can deploy your own copy of the app using the web-based flow:

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

## Documentation

For more information about using Node.js on Heroku, see these Dev Center articles:

- [10 Habits of a Happy Node Hacker](https://blog.heroku.com/archives/2014/3/11/node-habits)
- [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/getting-started-with-nodejs)
- [Heroku Node.js Support](https://devcenter.heroku.com/articles/nodejs-support)
- [Node.js on Heroku](https://devcenter.heroku.com/categories/nodejs)
- [Using WebSockets on Heroku with Node.js](https://devcenter.heroku.com/articles/node-websockets)
1. Open project folder.
2. Create heroku app: heroku create app-name
3. Open app on heroku: heroku open app-name
7 changes: 0 additions & 7 deletions app.json

This file was deleted.

22 changes: 14 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
var express = require('express')
var app = express()

app.set('port', (process.env.PORT || 5000))
app.use(express.static(__dirname + '/public'))
var express = require('express');
var app = express();

app.set('port', (process.env.PORT || 5000));

app.use(express.static(__dirname + '/public'));

// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');

app.get('/', function(request, response) {
response.send('Hello World!')
})
response.render('index');
});

app.listen(app.get('port'), function() {
console.log("Node app is running at localhost:" + app.get('port'))
})
console.log('Node app is running on port', app.get('port'));
});
59 changes: 32 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
{
"name": "node-js-sample",
"version": "0.2.0",
"description": "A sample Node.js app using Express 4",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"express": "^4.13.3"
},
"engines": {
"node": "4.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/heroku/node-js-sample"
},
"keywords": [
"node",
"heroku",
"express"
],
"author": "Mark Pundsack",
"contributors": [
"Zeke Sikelianos <[email protected]> (http://zeke.sikelianos.com)"
],
"license": "MIT"
"name": "sushi-inc",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "axel_sok",
"license": "ISC",
"dependencies": {
"body-parser": "^1.17.2",
"express": "^4.15.3",
"mongodb": "^2.2.31",
"jade": "^1.11.0"
},
"devDependencies": {
"nodemon": "^1.11.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.4",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"style-loader": "^0.18.2",
"webpack": "^3.4.1"
},
"engines": {
"node": "6.9.3"
}
}
28 changes: 28 additions & 0 deletions public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.jumbotron {
background: #532F8C;
color: white;
padding-bottom: 80px; }
.jumbotron .btn-primary {
background: #845ac7;
border-color: #845ac7; }
.jumbotron .btn-primary:hover {
background: #7646c1; }
.jumbotron h1 {
margin-bottom: .666667em; }
.jumbotron p {
color: #d9ccee;
max-width: 75%;
margin: 1em auto 2em; }
.navbar + .jumbotron {
margin-top: -20px; }
.jumbotron .lang-logo {
display: block;
background: #B01302;
border-radius: 50%;
overflow: hidden;
width: 100px;
height: 100px;
margin: auto;
border: 2px solid white; }
.jumbotron .lang-logo img {
max-width: 100%; }
17 changes: 0 additions & 17 deletions public/node.svg

This file was deleted.

13 changes: 13 additions & 0 deletions views/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
doctype html
html
head
title= pageTitle || 'Heroku NodeJS Deployment Demo !!!!!'
link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css')
link(rel='stylesheet', href='main.css')
body
.jumbotron
.container
h1.text-center= header || 'Try to use heroku =)'
p.text-center NodeJS apps are a snap to deploy, a joy to manage, and a cinch to scale on Heroku.
p.text-center Come see why thousands of NodeJS devs are hosting their apps on Heroku.
a.lang-logo(href='http://heroku.com/node'): img(src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAACK9JREFUeAHtnHmIVVUcx51mcsq0NCnLymnToppop32HrIQKsoWgbWgjiggkWqAN6o8iaCHakywokIoWKlul0lYLI7XF9sXKdjNNc/p8p3cfZ86c8959z3uf7775/eDju2c/53vuPdu945AhZqaAKWAKmAKmgClgCpgCpoApYAqYAqaAKWAKmAKmgClgCpgCpoApYAqYAqaAKWAKmAKmgCnQsgr09vYeCc/AL/AHzISToK1lG92MDUPwbpgBMXuTgH2bse4tVSdE3hjugJWQxh4m0pYtJUIzNAZRO+ES+B1qtWUkuB5GNENbCl8HhJwMn0PMHiNgWxgLU+FfCNkPeJ4F7YUXZU00AOH2hNcgZnMIONivG367wiuxRPjPhcP9dOaOKIBYm8M0WAUh+w7PM2CtSBZ93oQfB59AzJ4kYLtKeQzqMMRZD66GpRAy+V8D66UVirhrw8XwK4RsBZ63wIZp82z5eIixFpwO30LI9KQ8CJvXKwZpR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oL+myWtztxN2gzceqcRNMLGgDpP51Yh07dc54E+bDBLqwCC6Q7/BkKmfYoOCMsbNa6157kU/oCQLcfzBmid/URaMbOKh3jaPV8H7qSPs2y62y+EHvii7DvwYjpeW2dVr0Gfj8SERwfqXNXnHWIcMOgFzEsAxNXGstL/nZL0kIa6UyHTFVte7Sp0vojcDudDaE+hPcxVMKxIjWyJuwbRNaGfBnrzpxXTu3A/L48GfKiAv5kpYAqYAqaAKWAKmAKmgClgCpgCpoApYAqYAqaAKWAKmAKmgClgCpgCpoApYAqYAqaAKWAKFFCB/wDQj/WTziihlAAAAABJRU5ErkJggg==')
28 changes: 28 additions & 0 deletions views/public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.jumbotron {
background: #532F8C;
color: white;
padding-bottom: 80px; }
.jumbotron .btn-primary {
background: #845ac7;
border-color: #845ac7; }
.jumbotron .btn-primary:hover {
background: #7646c1; }
.jumbotron h1 {
margin-bottom: .666667em; }
.jumbotron p {
color: #d9ccee;
max-width: 75%;
margin: 1em auto 2em; }
.navbar + .jumbotron {
margin-top: -20px; }
.jumbotron .lang-logo {
display: block;
background: #B01302;
border-radius: 50%;
overflow: hidden;
width: 100px;
height: 100px;
margin: auto;
border: 2px solid white; }
.jumbotron .lang-logo img {
max-width: 100%; }