fix error, remove stuff, add stuff
This commit is contained in:
21
frontend/src/app.js
Normal file
21
frontend/src/app.js
Normal 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 );
|
||||
Reference in New Issue
Block a user