module.exports = function (context, req) {
    
    var https = require('https');

    var input = JSON.stringify(req.body);
    var userquery = input.split('&')[8].split('=')[1];
    var callback = input.split('&')[9].split('=')[1];
    var username = input.split('&')[6].split('=')[1];

    // define function to call other Azure function to get the weather
    function getMetar(icaocode) {

        context.log(`https://dogithub.azurewebsites.net/api/metarSlackbot?icao=${icaocode}&callback=${callback}`);

        https.get(`https://dogithub.azurewebsites.net/api/metarSlackbot?icao=${icaocode}&callback=${callback}`, function (res) {
            var body = ''; // Will contain the final response
            // Received data is a buffer.
            // Adding it to our body
            res.on('data', function (data) {
                body += data;
            });
            // After the response is completed, parse it and log it to the console
            res.on('end', function () {
                var parsed = JSON.parse(body);
                context.log(parsed);
            });
        })
            // If any error has occured, log error to console
            .on('error', function (e) {
                context.log("Got error: " + e.message);
            });
    }

    context.log('Input was %s', userquery);
    context.log('%s', userquery.length);

    // define regexpattern for IATA or ICAO airport codes, either 3 or 4 letters allowed
    var regexpattern = /^[a-zA-Z]+$/;


    if ((userquery.length == 3 || userquery.length == 4) && regexpattern.test(userquery)) {

        context.bindings.response = `Hello ${username}, I am getting your weather for ${userquery}, try again if you have not heard back in 20s.`;

        getMetar(userquery);

        context.done();
    }
};
@@ -114,24 +114,77 @@
 (req.body);%0A
+    var command = input.split('&')%5B7%5D.split('=')%5B1%5D;%0A
     var user
@@ -1341,307 +1341,255 @@
     
-context.log('Input was %25s', userquery);%0A    context.log('%25s', userquery.length);%0A%0A    // define regexpattern for IATA or ICAO airport codes, either 3 or 4 letters allowed%0A    var regexpattern = /%5E%5Ba-zA-Z%5D+$/;%0A%0A%0A    if ((userquery.length == 3 %7C%7C userquery.length == 4) && regexpattern.test(userquery)
+function getFlightStatus(flightnumber) %7B%0A        context.log(%60https://dogithub.azurewebsites.net/api/flightStatus?flightnumber=$%7Bflightnumber%7D&callback=$%7Bcallback%7D%60);%0A    %7D;%0A%0A    context.log('Input was %25s', userquery);%0A%0A    if (command == '/metar'
 ) %7B%0A
@@ -1763,24 +1763,133 @@
 serquery);%0A%0A
+        context.done();%0A    %7D%0A    else if (command == '/flightstatus') %7B%0A        getFlightStatus(userquery);%0A
         cont

Add getFlightStatus function placeholder.