Skip to content

Commit ff7c8e8

Browse files
committed
first commit
0 parents  commit ff7c8e8

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

ReadMe.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Node Apps
2+
## helloworld
3+
4+
# Installation
5+
6+
mkdir myapp
7+
cd myapp/
8+
jitsu install helloworld
9+
10+
*If you do not have `jitsu` installed you can install it via `npm install jitsu -g`*
11+
12+
13+
# Usage
14+
15+
### Starting helloworld locally
16+
17+
node bin/server
18+
19+
*Now you can visit http://localhost:8080 to view your application*
20+
21+
### Deploy helloworld to nodejitsu
22+
23+
jitsu deploy
24+
25+
*You will now be prompted for a `subdomain` to deploy your application on*
26+
27+
28+
# License
29+
30+
(The MIT License)
31+
32+
Copyright (c) 2013 Nodejitsu
33+
34+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
35+
36+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bin/server

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
3+
var http = require('http'),
4+
port = 8080,
5+
url = 'http://localhost:' + port + '/';
6+
/* We can access nodejitsu enviroment variables from process.env */
7+
/* Note: the SUBDOMAIN variable will always be defined for a nodejitsu app */
8+
if(process.env.SUBDOMAIN){
9+
url = 'http://' + process.env.SUBDOMAIN + '.jit.su/';
10+
}
11+
12+
http.createServer(function (req, res) {
13+
res.writeHead(200, {'Content-Type': 'text/plain'});
14+
res.write('hello, I know nodejitsu.');
15+
res.end();
16+
}).listen(port);
17+
18+
19+
20+
console.log('The http server has started at: ' + url);

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "example-helloworld",
3+
"version": "0.1",
4+
"author": {
5+
"name": "DeployR Inc.",
6+
"email": "support@deployr.com"
7+
},
8+
"description": "A very basic node.js helloworld application",
9+
"main": "",
10+
"repository": {
11+
"type": "git",
12+
"url": "git://github.com/sandbox-js/helloworld.git"
13+
},
14+
"keywords": [
15+
"nodeapps",
16+
"helloworld"
17+
],
18+
"homepage": "http://nodeapps.github.com/sandbox-js/helloworld",
19+
"scripts": {
20+
"start": "node ./bin/server"
21+
},
22+
"contributors": [
23+
{
24+
"name": "Sean",
25+
"email": "sean@gmail.com"
26+
}
27+
],
28+
"dependencies": {},
29+
"devDependencies": {},
30+
"engines": {
31+
"node": ">=0.4"
32+
},
33+
34+
"analyze": false
35+
}

0 commit comments

Comments
 (0)