Create Node Restful APIs with MySQL Database
Install Node JS and MySQL Software, create a database and import SQL file.
Go to terminal or command line.
Execute following commands to run this application.
# # ALIASES | |
# | |
status () { sudo service "$@" status; } | |
# usuage "status <servicename> | |
# | |
# Service Shortcuts | |
alias t-start='sudo service transmission-daemon start' | |
alias t-stop='sudo service transmission-daemon stop' | |
alias t-reload='sudo service transmission-daemon reload' | |
alias t-list='transmission-remote -n 'transmission:transmission' -l' |
<?php | |
header("Cache-Control: no-cache, must-revalidate"); | |
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); | |
header("Pragma: no-cache"); | |
function human_filesize($bytes, $decimals = 2) { | |
$sz = 'BKMGTP'; | |
$factor = floor((strlen($bytes) - 1) / 3); | |
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor]; | |
} |