This is the server implementation of icebreaQ. It is built with express
, node-gyp
, napi
, socket.io
.
node v14.20.1
mongodb-latest
We assume this project is installed on ubuntu 16.04 or macOS.
You should install
node v14.20.1
mongo db
WE RECOMMEND INSTALLING node
VIA nvm
- Install nvm
nvm install 14
nvm 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.sh
You 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 start
COMMON 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 |