- Copy the env file into a new file
.local.env
with necessary credentials yarn start
to start the serviceyarn test
to run tests
brew services start mysql
mysql_secure_installation
and configure password for root userbrew services stop mysql
mysql.server start
andmysql.server stop
to start and stop mysql respectively
mysql -u root -p
login as root userCREATE DATABASE url_shortener_db;
creates a database for our appUSE url_shortener_db;
check and see if we can use the databasemysql -h localhost -u root -p url_shortener_db
logout and login again as root user and use the created databaseCREATE USER 'url_shortener_user'@'localhost' IDENTIFIED BY '<enter password here>';
create new userGRANT ALL PRIVILEGES ON url_shortener_db.* TO 'url_shortener_user'@'localhost';
grant this user all the privileges for the databasemysql -h localhost -u url_shortener_user -p
login as newly created user
/url
: POST URL and retrieve an already existing or new short link/url/:shortUrl
: GET call to simulate user visiting short link/stats/:shortUrl
: GET stats of the short link