Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
cleaned up node0_10 app to include native and git deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Nugmanov and Dmitriy Kalinin committed Mar 28, 2013
1 parent 9bf3bfb commit 82a7ca5
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 0 deletions.
33 changes: 33 additions & 0 deletions node/node0_10/app.js
@@ -0,0 +1,33 @@
var express = require("express");
var app = express();

app.get("/node_version", function(req, res){
res.send(process.version);
});

app.get("/git_module", function(req, res){
// Tested: git module support
var semver = require("semver");

if (semver && semver.valid("1.2.3")) {
res.send("ok");
} else {
res.send("fail");
}
});

app.get("/native_ext", function(req,res) {
// Tested: native extensions via node-gyp
var bcrypt = require("bcrypt");

var salt = bcrypt.genSaltSync(10);
var hash = bcrypt.hashSync("B4c0/\/", salt);

if (bcrypt.compareSync("B4c0/\/", hash)) {
res.send("ok");
} else {
res.send("fail");
}
});

app.listen(process.env.VCAP_APP_PORT || 3000);
114 changes: 114 additions & 0 deletions node/node0_10/npm-shrinkwrap.json

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

15 changes: 15 additions & 0 deletions node/node0_10/package.json
@@ -0,0 +1,15 @@
{
"name": "node0_10",
"version": "0.0.1",

"dependencies" : {
"express": "3.1.x",
"bcrypt": "0.7.5",
"semver": "git://github.com/isaacs/node-semver.git#ef7cb88c00"
},

"engines": {
"node": "0.10.x",
"npm": ">= 1.1.2"
}
}

0 comments on commit 82a7ca5

Please sign in to comment.