This is a very basic REST API made for serving data to the client side of a project made to test and implement new technologies, such as typescript in the backend side.
-
/v1/products
Retrieves a list of all the registered products (Medicines, in this case)
GET
[ { "id": number, "name": string, "detail": string, "quantity": number, "admin_route": string, "taxes_pctge": number, "untaxed_price": number, "created_at": Date, } ]
-
/v1/sales
Retrieves a list of all the registered sales
GET
[ { "id": number, "untaxed_value": number, "total_value": number, "sold_at": Date, } ]
-
/v1/images/:productId
Retrieves the image associated with a given product ID
GET
{ "id": number, "medicine_id": number, "image_url": string, }
- The database Script (with populated values) is in the file:
/src/sql/database.sql
- The pool configuration file (for the MySQL connection to the database) is:
/src/dbconnection.ts
- All the app configuration, routes and middlewares are applied inside the
App
class in the file:/src/app.ts