API for Live learn - Live learn project
- NodeJS >= v8.x, npm >= 5.x
- MongoDB >= 3.6
- GraphicsMagick
- FFMPEG if use to upload, convert video file service
- Install all softwares above
- CD to app root
- Run
npm run dev
to startweb app
in development environment - Create
.env
file in the root folder by copyenv.example
content file and update config to your env - Create
[env].json
file in theconfig
folder. Copy content fromdevelopment.json
and update config to your env
- Install api doc by
npm install apidoc -g
- CD to folder and run
apidoc -i server/module -o apidocs
- Create
.env
file in the test folder by copyenv.example
content file and update config to your env - Create
test.json
file in theconfig
folder. Copy content fromdevelopment.json
and update config to your env - Run
npm test
- For file upload in the server, should create a cron job to remove media file in the tmp folder if it is too old. cause tmp folder is just reset if server is rebooted
- Example the job run every hour and remove media file older than 4h
0 * * * * /tmp/*.mp4 -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.MP4 -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.mov -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.MOV -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.mkv -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.MKV -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.jpg -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.JPG -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.jpeg -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.JPEG -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.png -type d -mmin +240 -print0 | xargs -0 rm -rf
0 * * * * find /tmp/*.PNG -type d -mmin +240 -print0 | xargs -0 rm -rf
nano script.js
=> addawait require('./scripts/update-data-webinar')();
like example in file- run
server/script.js