<commit_before>const path = require("path");
const fs = require("fs");
const logger = require("./logger/Logger");
const restify = require("restify");
const environment = process.env.NODE_ENV || "development";

logger.Initialize(path.join(__dirname, "../logs"));
logger.LogInfo(`Server is running in '${environment}' environment`)

var server;

if(environment == "production") 
{
  server = restify.createServer({
    certificate: fs.readFileSync("/etc/letsencrypt/live/anotherone.ca/cert.pem"),
    key: fs.readFileSync("/etc/letsencrypt/live/anotherone.ca/privkey.pem"),
    name: "Botanist",
  });

  server.listen(443);
}
else
{
  server = restify.createServer({
    name: "Botanist"
  });

  server.listen(80);
}

logger.LogInfo(`Server name: ${server.name} Server url: ${server.url}`);

//serving static files
server.get(/.*/, restify.serveStatic({
  "directory": path.join(__dirname, "../public"),
  "default": "index.html"
 }));

server.post("/command/:name", function(request, response, next){
  //req.params
  res.json(200, {
    text: "JSON data: " + JSON.stringify(request.params)
  });
  return next();
});<commit_msg>-added slack command ping GET request handler. -fixed error.<commit_after>const path = require("path");
const fs = require("fs");
const logger = require("./logger/Logger");
const restify = require("restify");
const environment = process.env.NODE_ENV || "development";

logger.Initialize(path.join(__dirname, "../logs"));
logger.LogInfo(`Server is running in '${environment}' environment`)

var server;

if(environment == "production") 
{
  server = restify.createServer({
    certificate: fs.readFileSync("/etc/letsencrypt/live/anotherone.ca/fullchain.pem"),
    key: fs.readFileSync("/etc/letsencrypt/live/anotherone.ca/privkey.pem"),
    name: "Botanist",
  });

  server.listen(443);
}
else
{
  server = restify.createServer({
    name: "Botanist"
  });

  server.listen(80);
}

logger.LogInfo(`Server name: ${server.name} Server url: ${server.url}`);

//serving static files
server.get(/.*/, restify.serveStatic({
  "directory": path.join(__dirname, "../public"),
  "default": "index.html"
 }));

/*
Before submitting a command to your server, Slack will occasionally send your command URLs a simple GET request to verify the certificate. These requests will include a parameter ssl_check set to 1. Mostly, you may ignore these requests, but please do respond with a HTTP 200 OK.
*/
server.get("/command/:name", function(request, response, next){
  response.send(200, "yup!");
  return next();
});

server.post("/command/:name", function(request, response, next){
  response.json(200, {
    text: "JSON data: " + JSON.stringify(request.params)
  });
  return next();
});
{'fraction_non_alphanumeric': 0.1752958579881657, 'fraction_numerical': 0.008505917159763314, 'mean_word_length': 4.6471816283924845, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5846285', 'n_tokens_mistral': 865, 'n_tokens_neox': 840, 'n_words': 204}