fix error, remove stuff, add stuff

This commit is contained in:
janis
2023-05-31 14:06:04 +02:00
parent bf4e85f6c1
commit 5099959082
6 changed files with 23 additions and 72 deletions

21
frontend/src/app.js Normal file
View File

@@ -0,0 +1,21 @@
const express = require( 'express' );
let app = express();
const path = require( 'path' );
const fs = require( 'fs' );
const bodyParser = require( 'body-parser' );
const exec = require( 'child_process' ).exec;
app.use( bodyParser.urlencoded( { extended: false } ) );
app.use( bodyParser.json() );
function execute(command, callback){
exec(command, function(error, stdout, stderr){ callback(stdout); });
};
app.get( '/api/getEngines', ( request, response ) => {
execute( 'ImageVideoUpscaler-cli -p', out => {
response.send( out );
} );
} );
app.listen( 8081 );