Backend for Quizio!
- Run
cp .env.example .envand add all the relevant environment key-value pairs. - Run
cp src/config/config.sample.js src/config/config.jsand update all config variables using the following steps:- Generate a clientId and clientSecret from developer console from arceus and change the
clientIdandclientSecretfield accordingly.
- Generate a clientId and clientSecret from developer console from arceus and change the
- Run
npm install && npm startto start the server.
OR
- Run
docker-compose upto start the server.
- Follow this Blog to read about setting up
apacheandhttpdserver first. - Add
127.0.0.1 quizioapi.sdslabs.localto/etc/hosts - Add the following lines to
/usr/local/etc/httpd/extra/httpd-vhosts.conf
<VirtualHost quizioapi.sdslabs.local:80>
ServerName quizioapi.sdslabs.local
ProxyRequests On
ProxyPreserveHost On
ProxyPass / http://localhost:5050/
ProxyPassReverse / http://localhost:5050/
LogLevel warn
</VirtualHost>
- run
sudo apachectl start. - To verify the setup was successful, go to
http://quizioapi.sdslabs.local/and you should be able to see the homepage!
nanoid is used for generating unique ids to identify every document in the db. The ids follow the following format: quizioID.${nanoid()}.
Any client making an API call must confirm that the id is valid using the /api/v2/utils/verifyQuizioID/:id endpoint.