This is an server that allows to display flight anomaly data on the web page. The web presents to the pilot all of the anomaly from is flight's data.
link to the video:
https://www.youtube.com/watch?v=M8LlPB5nqvE
The <Model-View-Controller>
(MVC) is an architectural pattern that separates an application into three main logical components: the <model>
, the <view>
, and the <controller>
. Each of these components are built to handle specific development aspects of an application. (The explanation taken from tutorialspoint Web).
In our project the user choose the type of algorithm (linear or hybrid), in addition the user uploads to the server (by the <view>
) the two CSV files (train csv, test csv).
The files and the flag (which indicates the type of algorithm) are then transferred to the <controller>
which transfers the information from the CSV files to the json file.
The <controller>
saves the json files and passes their address to the <model>
.
The <model>
sends the information to the requested algorithm (which is coded in the CPP) and returns the result to the <controller>
.
Make sure that all the libraries must be installed
- this server should run on linux.
- nodejs -
sudo apt install nodejs
- express library -
npm i express
- express-fileupload library -
npm i express-fileupload
- node-fetch library -
npm install -g node-gyp
- node-gyp library -
npm install -g node-gyp
- init node server -
npm init
- in model directoy:
- node-gyp configure -
node-gyp configure
- node-gyp build -
node-gyp build
- in controller directory:
- start server -
node expServer.js
The request body must be as the format below:
-
<model_name><train_file><test_file>
-
curl example:
curl --location --request POST 'localhost:8080/upload' \
--form '="hybrid"' \
--form 'TrainFile=@"/home/user/Anomaly-Detection-Server/files/trainFile.csv"' \
--form 'TestFile=@"/home/user/Anomaly-Detection-Server/files/testFile.csv"'