From ca01e3112f5ec880a9af25910aab7d4f4bdd9388 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 2 May 2019 23:05:14 -0600 Subject: [PATCH] don't break telebit, duh --- server.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index 34938da..33e6e40 100644 --- a/server.js +++ b/server.js @@ -118,8 +118,11 @@ app.get('/api/dns/:domain', function (req, res, next) { dig.resolveJson(query, opts); }); -// curl -L http://localhost:3000/api/dns/example.com?type=A -console.log("Listening on localhost:3000"); -app.listen(3000); -console.log("Try this:"); -console.log("\tcurl -L 'http://localhost:3000/api/dns/example.com?type=A'"); +module.exports = app; +if (require.main === module) { + // curl -L http://localhost:3000/api/dns/example.com?type=A + console.log("Listening on localhost:3000"); + app.listen(3000); + console.log("Try this:"); + console.log("\tcurl -L 'http://localhost:3000/api/dns/example.com?type=A'"); +}