Permalink
Browse files

cleaned up node0_6 app to include native and git deps

  • Loading branch information...
1 parent 7f3f8ff commit 9bf3bfbdd3b5dfb6b490908cb4d945c152b4b1e7 Bob Nugmanov and Dmitriy Kalinin committed Mar 28, 2013
View
@@ -0,0 +1,33 @@
+var express = require("express");
+var app = express.createServer();
+
+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);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,15 @@
+{
+ "name": "node0_6",
+ "version": "0.0.1",
+
+ "dependencies" : {
+ "express": "2.5.x",
+ "bcrypt": "0.7.x",
+ "semver": "git://github.com/isaacs/node-semver.git#14a426809"
+ },
+
+ "engines": {
+ "node": "0.6.x",
+ "npm": "1.1.x"
+ }
+}
@@ -1,17 +0,0 @@
-var app = require("express").createServer();
-var bcrypt = require("bcrypt"); // native dependency
-
-app.get("/", function(req, res) {
- var salt = bcrypt.genSaltSync(10);
- var hash = bcrypt.hashSync("B4c0/\/", salt);
- if (bcrypt.compareSync("B4c0/\/", hash))
- res.send("hello from express");
- else
- res.send("");
-});
-
-var port = process.env.VCAP_APP_PORT || 3000;
-
-app.listen(port, function () {
- console.log("Express server started on port %s", app.address().port);
-});
@@ -1,12 +0,0 @@
-{
- "name" : "node-dependencies06",
- "version" : "0.1.0",
- "dependencies" : {
- "express" : "2.5.x",
- "bcrypt" : ""
- },
- "engines": {
- "node": "0.6.20",
- "npm": "1.1.65"
- }
-}

0 comments on commit 9bf3bfb

Please sign in to comment.