diff --git a/.gitignore b/.gitignore index 8a2917e..efc52a0 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,11 @@ typings/ # Webstorm .idea + +# exclude everything +static/video/* +static/uploaded/* + +# exception to the rule +!static/video/.gitkeep +!static/uploaded/.gitkeep diff --git a/app.js b/app.js index 3003983..e224999 100644 --- a/app.js +++ b/app.js @@ -12,7 +12,7 @@ var app = express(); var mysql = require('mysql'); var bodyParser=require("body-parser"); var connection = mysql.createConnection({ - host : 'localhost', + host : '192.168.1.119', user : 'comp5322', password : 'comp5322project', database : 'comp5322' @@ -125,7 +125,7 @@ function call_ffmpeg(file_path){ global.call_ffmpeg = call_ffmpeg; //Integrate with Shawn's code end - +let eventEmit = new events.EventEmitter() // all environments app.set('port', process.env.PORT || 8080); @@ -154,6 +154,10 @@ app.get('/home/profile',user.profile);//to render users profile app.get('/home/upload_video',user.uploadvideo);//to render upload_file.html app.get('/home/my_video',user.myvideo);//to render my_video.html app.get('/static/*', display_static_resoures); //static resources +app.post('/upload', async function(request,response) { + let uploaded_file_path = await upload_process(request,response) + await call_ffmpeg(uploaded_file_path); +}); //Middleware -app.listen(8080) -console.log('http://localhost:8080'); \ No newline at end of file +app.listen(8081) +console.log('http://localhost:8081'); \ No newline at end of file diff --git a/docs/db-setup.sql b/docs/db-setup.sql index e0b47d7..77f825c 100644 --- a/docs/db-setup.sql +++ b/docs/db-setup.sql @@ -1,7 +1,17 @@ create database comp5322; -grant all on comp5322.* to comp5322@localhost identified by 'comp5322project' WITH GRANT OPTION; -grant all on comp5322.* to comp5322@'127.0.0.1' identified by 'comp5322project' WITH GRANT OPTION; +CREATE USER 'root'@'%' IDENTIFIED BY 'qwerqwer'; + +GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; + +CREATE USER 'comp5322'@'localhost' IDENTIFIED BY 'comp5322project'; + +GRANT ALL PRIVILEGES ON *.* TO 'comp5322'@'localhost' WITH GRANT OPTION; + +CREATE USER 'comp5322'@'%' IDENTIFIED BY 'comp5322project'; + +GRANT ALL PRIVILEGES ON *.* TO 'comp5322'@'%' WITH GRANT OPTION; + flush privileges; CREATE TABLE IF NOT EXISTS `comp5322`.`users` (