Created
August 28, 2010 22:17
-
-
Save earl/555639 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
exports.httpConfig = { | |
staticDir: 'static' | |
}; | |
exports.urls = [ | |
['/', require('actions')], | |
]; | |
exports.auth = { | |
'/admin/': {foo: '62cdb7020ff920e5aa642c3d4066950dd1f01f4d'}, | |
}; | |
exports.middleware = [ | |
require('ringo/middleware/gzip').middleware, | |
require('ringo/middleware/etag').middleware, | |
require('ringo/middleware/responselog').middleware, | |
require('ringo/middleware/error').middleware, | |
require('ringo/middleware/notfound').middleware, | |
require('httpsonly').middleware, | |
require('ringo/middleware/basicauth').middleware, | |
]; | |
exports.app = require('ringo/webapp').handleRequest; | |
exports.macros = [ | |
require('ringo/skin/macros'), | |
require('ringo/skin/filters'), | |
]; | |
exports.charset = 'UTF-8'; | |
exports.contentType = 'text/html'; |
This file contains hidden or 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
var log = require('ringo/logging').getLogger(module.id); | |
exports.middleware = function (app) { | |
return function (req) { | |
log.info(req.scheme); | |
if (req.scheme != 'https') { | |
log.info('redirecting to https'); | |
return { | |
status: 303, | |
headers: {location: 'https://' + req.host + ':8443' + req.path}, | |
body: [] | |
}; | |
} | |
return app(req); | |
}; | |
}; |
This file contains hidden or 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
<Call name="addConnector"> | |
<Arg> | |
<New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> | |
<Set name="port">8443</Set> | |
<Set name="keystore"><SystemProperty name="jetty.home" default="." />/config/keystore</Set> | |
<Set name="password">password</Set> | |
<Set name="keyPassword">password</Set> | |
<Set name="truststore"><SystemProperty name="jetty.home" default="." />/config/keystore</Set> | |
<Set name="trustPassword">password</Set> | |
</New> | |
</Arg> | |
</Call> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment