- Notifications
You must be signed in to change notification settings - Fork0
ushangt/PluralsightCodingExercise
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Backend: Node.js/Express/REST
- Javascript Frontend: Node.js/Bootstrap Material/Jade
- Database: sqlite3, Sequelize, (Ruby for initialization)
1. Install dependencies:
Make sure you haveNode JS
andnpm
installed. If you want to re-create the DB you will also needRuby
installed.After that open Terminal at the project folder and hitnpm install
2. Load the Database:
The database related files are all in thedb
folder. It has the challenegeCSV
dump as well.The first step is to move thecsv
file contents intosqlite3
database. It is done using a simpleRuby
script. I amnot much of an expert on ruby and thus wrote some simple code. Anyways
cd db/seed
and typeruby seed-sqlite.rb
This generates aplural-sight.sqlite3
database file in thedb
folder.
3. Run in development mode:
Navigate back to the projectroot
folder and type:
npm start
and browsehttp://localhost:3000/
on any modern browser.
To check the api endpoints either usePOSTMAN
orINSOMNIA
.
- GET:
/api/question
- Gets all the questions form the database - GET:
/api/question/:id
- Gets the question specified by theid
- POST:
api/question
- Creates a new question & adds it to the database - PUT:
/api/question/:id
- Updates an existing question with the specifiedid
Example Body for POST & PUT calls:
{ "question" : "What is 400 * 4 ?", "answer" : "1600", "distractors" : "8000, 80"}
About
Coding Exercise for Pluralsight
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.