Skip to content

Commit

Permalink
Please enter the commit message for your changes. Lines starting
Browse files Browse the repository at this point in the history
  • Loading branch information
williehk committed Apr 1, 2018
1 parent 91818b1 commit c85d958
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ typings/

# Webstorm
.idea

# exclude everything
static/video/*
static/uploaded/*

# exception to the rule
!static/video/.gitkeep
!static/uploaded/.gitkeep
12 changes: 8 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
app.listen(8081)
console.log('http://localhost:8081');
14 changes: 12 additions & 2 deletions docs/db-setup.sql
Original file line number Diff line number Diff line change
@@ -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` (
Expand Down

0 comments on commit c85d958

Please sign in to comment.