Skip to content

Instantly share code, notes, and snippets.

View gpimblott's full-sized avatar

G Pimblott gpimblott

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gpimblott on github.
  • I am gpimblott (https://keybase.io/gpimblott) on keybase.
  • I have a public key whose fingerprint is 8571 C39D E155 7832 7B86 CF83 88EC 8C77 D7E4 20E4

To claim this, I am signing this object:

@gpimblott
gpimblott / letsencrypt.js
Created March 3, 2017 16:08
NodeJS Route for LetsEncrypt cert validation
// Lets encrypt response
var letsEncryptUrl = process.env.LETS_ENCRYPT;
var letsEncryptResponse = process.env.LETS_ENCRYPT_RESPONSE;
if( letsEncryptResponse != undefined && letsEncryptResponse != undefined) {
self.app.get('/.well-known/acme-challenge/' + letsEncryptUrl, function (req, res) {
res.send(letsEncryptResponse);
res.end();
});
}
@gpimblott
gpimblott / example_app.js
Created February 4, 2017 10:29
Portable node.js across Heroku and OpenShift
/**
* Get port from environment and store in Express.
*
* Heroku uses 'port' environment variable
* OpenShift uses 'OPENSHIFT_NODEJS_PORT' environment variable
* locally 8090 will be used
*/
var server_port = process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || 8090;
var server_ip_address = process.env.OPENSHIFT_NODEJS_IP;
@Bean
RoutesBuilder ProcessZipFile() {
return new RouteBuilder() {
private ProcessZipFileEntry fileProcessor = new ProcessZipFileEntry();
private MissingFilesProcessor missingFileProcessor = new MissingFilesProcessor();
@Override
public void configure() throws Exception {
// This is the location to look for the metadata file