readme, changes to api structure
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Thanks for checking out *Express Spices*, my from-the-ground-up e-commerce solution for buying spices! The product catalog for this store is modeled after [World Spice Merchants](https://www.worldspice.com/), sorted into categories by geographical regions.
|
||||
|
||||
Payment information is supported through the Stripe API, with session support and user management with Express Sessions. The backend features a full REST API built in Express, connects to a PostgreSQL database, and is documented with Swagger. The app features a frontend built with React, TypeScript, and Sass.
|
||||
Payment information will be supported through the Stripe API, with session support and user management with Express Sessions. The backend features a full REST API built in Express, which connects to a PostgreSQL database, hosted with [Supabase](app.supabase.com). [Documentation for the API](https://mikayla-spice-market-api.herokuapp.com/api-docs) is provided with Swagger. The app features a frontend built with React, TypeScript, and Sass.
|
||||
|
||||
## Installing and Running the Development Build Locally
|
||||
1. Clone the project repository from the root level.
|
||||
@@ -12,3 +12,7 @@ Payment information is supported through the Stripe API, with session support an
|
||||
5. Still within ``/client``, run ``npm run dev`` to start the Vite development server.
|
||||
6. In another terminal window at the root directory level, run ``npm start`` to start the localhost server.
|
||||
7. It should indicate that the server is listening on its designated port, and log each database transaction to the console.
|
||||
|
||||
## Accessing the Project and its REST API Online
|
||||
1. The REST API for this project is exposed at https://mikayla-spice-market-api.herokuapp.com/
|
||||
2. The client site will be hosted on Netlify and is not online as of yet.
|
||||
@@ -3,7 +3,7 @@ const AuthServiceInstance = new AuthService();
|
||||
const router = require('express').Router();
|
||||
|
||||
module.exports = (app, passport) => {
|
||||
app.use('/api/auth', router);
|
||||
app.use('/auth', router);
|
||||
|
||||
router.post('/register', async (req, res, next) => {
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,7 @@ const CartService = require('../services/CartService');
|
||||
const CartServiceInstance = new CartService();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/cart', router);
|
||||
app.use('/cart', router);
|
||||
|
||||
// logic for global cart entries
|
||||
router.get('/', async (req, res, next) => {
|
||||
|
||||
@@ -3,7 +3,7 @@ const CategoryService = require('../services/CategoryService');
|
||||
const CategoryInstance = new CategoryService();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/category', router);
|
||||
app.use('/category', router);
|
||||
|
||||
router.get('/', async (req, res, next) => {
|
||||
const { name } = req.query;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const router = require('express').Router();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/orders', router);
|
||||
app.use('/orders', router);
|
||||
|
||||
router.get('/', async (req, res, next) => {
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,7 @@ const ProductService = require('../services/ProductService');
|
||||
const ProductServiceInstance = new ProductService();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/product', router);
|
||||
app.use('/product', router);
|
||||
|
||||
router.get('/', async (req, res, next) => {
|
||||
const { name } = req.query;
|
||||
|
||||
@@ -3,7 +3,7 @@ const RegionsService = require('../services/RegionsService');
|
||||
const RegionsInstance = new RegionsService();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/regions', router);
|
||||
app.use('/regions', router);
|
||||
|
||||
router.get('/', async (req, res, next) => {
|
||||
const { name } = req.query;
|
||||
|
||||
@@ -4,7 +4,7 @@ const UserService = require('../services/UserService');
|
||||
const UserServiceInstance = new UserService();
|
||||
|
||||
module.exports = (app) => {
|
||||
app.use('/api/user', router);
|
||||
app.use('/user', router);
|
||||
|
||||
router.get('/:userId', async (req, res, next) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user