Created
June 14, 2010 07:40
-
-
Save DracoBlue/437399 to your computer and use it in GitHub Desktop.
Blogpost: http://dracoblue.net/dev/-/171/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// picard_sample/app.js | |
require('./config/env') | |
get('/', function(){ | |
return { text: '<h1>Hello to TestApp!</h1>' } | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// express_sample.js | |
// Launched with this command: | |
// $ EXPRESS_ENV="production" node express_sample.js | |
require('express') | |
get('/', function(){ | |
this.contentType('html') | |
return '<h1>Welcome to Testapp</h1>' | |
}) | |
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fab_sample.js | |
with ( require( "fab" ) ) | |
( fab ) | |
( listen, 8080 ) | |
( /^\// ) | |
( "<h1>Welcome to TestApp!</h1>" ) | |
( 404 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// spludo_sample/controllers/main.js | |
new Controller("", { | |
"execute": function(params, context) { | |
return function(cb) { | |
context.headers["Content-Type"] = "text/html"; | |
cb("<h1>Welcome to Testapp</h1>"); | |
} | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// spludo_sample/run_server.js | |
require("spludo/core"); | |
new ServerApplication({ | |
port: 8080 | |
}).run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment