A simple quiz builder
To setup the server, enter the client directory.
$ cd server
Create a .env
file and copy the code below into the file.
PORT=5000
TOKEN_SECRET=<generated-token-secret>
MONGODB_CONNECTION_URL=<mongodb-connection-url>
MONGODB_CONNECTION_URL_TEST=<mongodb-connection-test-url>
Create a MongoDB Cluster and add replace <mongodb-connection-url>
& <mongodb-connection-test-url>
with the actual connection url. Make sure the database name is included in the url.
To generate the TOKEN_SECRET, run the following commands below
$ node -i
then
> require('crypto').randomBytes(32).toString('hex')
Replace with the hexa-decimal output from the command above.
$ npm test
$ npm run test:file <path-to-test-file>
$ npm start
$ npm run start:dev
https://documenter.getpostman.com/view/6884204/UzR1LNRU
To setup the client, enter the client directory.
$ cd client
Create a .env
file and copy the code below into the file.
REACT_APP_APPID=<generated-token-secret>
REACT_APP_DOMAIN=http://localhost:3000
REACT_APP_API_DOMAIN=http://localhost:5000
To generate the REACT_APP_APPID, run the following commands below
$ node -i
then
> require('crypto').randomBytes(32).toString('hex')
$ npm start
Open http://localhost:3000 to view it in the browser.
$ npm run build