programming-courses ๐ป
- as a user I will be able to see programming courses
- as a user I should be able to see courses details
- as a user I should be able to add courses
- public
- styleCourse.css
- style.css
- src
- database
- queries
- getData.js
- postData.js
- getDataId.js
- db_build.sql
- db_build.js
- db_connection.js
- handlers
- home.js
- getCourse.js
- addCourse.js
- error.js
- index.js
- views
- layouts
- main.hbs
- partials
- header.hbs
- helpers
- index.js
- linkcourse.js
- home.hbs
- course.hbs
- serverError.hbs
- notFound.hbs
- app.js
- server.js
GET ' / '
- Get data (about the courses) from the database and send it to the front-end by render
GET '/course/[id]'
- get id of coures by req.params and get data from database depend on [id]
- send data to the front-end by render
POST /addcourse
- add course details
- insert data into database
To use our Repo without heroku database,you should:
- git clone this repo
- Put in terminal : npm install .
- create database CREATE DATABASE (dbName); ;
- create uesrname and password CREATE USER (userName) with password (password); ;
- grant prinileges GRANT ALL PRIVILEGES ON DATABASE (dbName) TO (userName); ;
- make config.env file and put DATABASE_URL= postgres://uesrname:password@localhost:5432/dbname
- Put in terminal : node database/db_build.js.
- Then put in terminal : npm run dev to run the server.