From f818b79c7a6fe3a5cff535bdd9497550c2e8f73c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 12 Dec 2015 07:18:06 +0000 Subject: [PATCH] updates to static server --- tests/acme-challenge/.gitkeep | 0 tests/acme-challenge/hello | 1 + tests/config.js | 3 +++ tests/serve-acme-challenges.js | 2 +- tests/test.bash | 2 ++ 5 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/acme-challenge/.gitkeep create mode 100644 tests/acme-challenge/hello create mode 100644 tests/test.bash diff --git a/tests/acme-challenge/.gitkeep b/tests/acme-challenge/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/acme-challenge/hello b/tests/acme-challenge/hello new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/tests/acme-challenge/hello @@ -0,0 +1 @@ +hello diff --git a/tests/config.js b/tests/config.js index ec07da5..fe4e646 100644 --- a/tests/config.js +++ b/tests/config.js @@ -1,7 +1,10 @@ 'use strict'; +var path = require('path'); + module.exports = { server: "https://acme-staging.api.letsencrypt.org/directory" , tlsSni01Port: 5001 , http01Port: 80 +, webrootPath: path.join(__dirname, "acme-challenge") }; diff --git a/tests/serve-acme-challenges.js b/tests/serve-acme-challenges.js index c23c1fe..31c3ad0 100644 --- a/tests/serve-acme-challenges.js +++ b/tests/serve-acme-challenges.js @@ -37,7 +37,7 @@ app.use('/', function (req, res, next) { // handle static requests to /.well-known/acme-challenge app.use( '/.well-known/acme-challenge' -, express.static(path.join(__dirname, 'acme-challenge'), { dotfiles: undefined }) +, express.static(config.webrootPath, { dotfiles: undefined }) ); diff --git a/tests/test.bash b/tests/test.bash new file mode 100644 index 0000000..3ae1417 --- /dev/null +++ b/tests/test.bash @@ -0,0 +1,2 @@ +curl http://localhost:80/.well-known/acme-challenge/hello +curl https://localhost.daplie.com:5001/.well-known/acme-challenge/hello