This is the server implementation of icebreaQ. It is built with express, node-gyp, napi, socket.io.
node v14.20.1mongodb-latest
We assume this project is installed on ubuntu 16.04 or macOS.
You should install
node v14.20.1mongo db
WE RECOMMEND INSTALLING node VIA nvm
- Install nvm
nvm install 14nvm use 14
If you want to use your own MONGO DB environment, then
- download the git repository and install dependencies
git clone https://github.com/Team-ILA/icebreaQ-server.git
cd icebreaQ-server
npm install- set configuration for the server
cat .env.example > .env
sh ./configure_bindings.shYou should fill all the environment variables correctly in .env as described.
# FOR DEV (tracks code changes)
npm run dev
# FOR PRODUCTION
npm run build
npm startCOMMON PREFIX: /api
| METHOD | API | DESCRIPTION | NOTES |
|---|---|---|---|
POST |
/users/resgister |
sign up users with email, password, username. | |
POST |
/users/login |
sign in users with registered email and password. | |
GET |
/users |
get user info if a user is logged in. (session) | |
POST |
/quiz |
create a quiz | requires login |
GET |
/quiz/:quizId |
get information of a quiz | requires login |
GET |
/quiz/:quizId |
get information of a quiz | requires login |