async function startRestServer() {
    if (os.startsWith(`win`)) {
        // Get correct python directory for windows
        return new Promise(resolve => {
            exec(`dir /B "${__dirname}\\python_modules\\Python3*"`, async (err, stdout) => {
                const winPath = stdout.replace(/[^ -~]+/g, ``) || `Python36`;
                const startCmd = `node  "${__dirname}\\..\\node_modules\\nopy\\src\\nopy.js"`;
                const alt = `node "${__dirname}\\..\\..\\nopy\\src\\nopy.js"`;
                const target = `${__dirname}\\..\\python_modules\\${winPath}\\Scripts\\xbox-rest-server.exe`;

                const server = await _startServer([startCmd, alt], target);
                resolve(server);
            });
        });
    } else {
        // Linux and MAC -- if not found in node_modules try root project
        const startCmd = `${__dirname}/../node_modules/nopy/src/nopy.js`;
        const alt = `${__dirname}/../../nopy/src/nopy.js`;
        const target = `${__dirname}/../python_modules/bin/xbox-rest-server`;

        const server = await _startServer([startCmd, alt], target);
        return Promise.resolve(server);
    } // endElse
} // endStartRestServer
/**
 * Start the Xbox Smartglass rest server
 *
 * @returns {Promise<void>}
 */
Start the Xbox Smartglass rest server
@returns {Promise}
Start the Xbox Smartglass rest server @returns { Promise }
async function startRestServer() {
    if (os.startsWith(`win`)) {
        return new Promise(resolve => {
            exec(`dir /B "${__dirname}\\python_modules\\Python3*"`, async (err, stdout) => {
                const winPath = stdout.replace(/[^ -~]+/g, ``) || `Python36`;
                const startCmd = `node  "${__dirname}\\..\\node_modules\\nopy\\src\\nopy.js"`;
                const alt = `node "${__dirname}\\..\\..\\nopy\\src\\nopy.js"`;
                const target = `${__dirname}\\..\\python_modules\\${winPath}\\Scripts\\xbox-rest-server.exe`;
                const server = await _startServer([startCmd, alt], target);
                resolve(server);
            });
        });
    } else {
        const startCmd = `${__dirname}/../node_modules/nopy/src/nopy.js`;
        const alt = `${__dirname}/../../nopy/src/nopy.js`;
        const target = `${__dirname}/../python_modules/bin/xbox-rest-server`;
        const server = await _startServer([startCmd, alt], target);
        return Promise.resolve(server);
    } 
} 
async function startRestServer ( ) { if ( os . startsWith ( ` ` ) ) { return new Promise ( resolve => { exec ( ` ${ __dirname } \\ \\ ` , async ( err , stdout ) => { const winPath = stdout . replace ( / [^ -~]+ / g , ` ` ) || ` ` ; const startCmd = ` ${ __dirname } \\ \\ \\ \\ \\ ` ; const alt = ` ${ __dirname } \\ \\ \\ \\ \\ ` ; const target = ` ${ __dirname } \\ \\ \\ ${ winPath } \\ \\ ` ; const server = await _startServer ( [ startCmd , alt ] , target ) ; resolve ( server ) ; } ) ; } ) ; } else { const startCmd = ` ${ __dirname } ` ; const alt = ` ${ __dirname } ` ; const target = ` ${ __dirname } ` ; const server = await _startServer ( [ startCmd , alt ] , target ) ; return Promise . resolve ( server ) ; } }
Start the Xbox Smartglass rest server
 @returns {Promise<void>}
Start the Xbox Smartglass rest server @returns { Promise<void > }
// Get correct python directory for windows // Linux and MAC -- if not found in node_modules try root project // endElse // endStartRestServer