Skip to content

Commit

Permalink
update API docs enpoint #11
Browse files Browse the repository at this point in the history
  • Loading branch information
davydocsurg committed Mar 30, 2023
1 parent b4c1451 commit 366d4d1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"mongoose": "^6.7.0",
"multer": "^1.4.5-lts.1",
"slugify": "^1.6.5",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^4.6.2",
"swagger-jsdoc": "^6.1.0",
"swagger-ui-express": "^4.3.0",
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"typescript": "^4.8.4",
Expand Down
1 change: 1 addition & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "./routes/v1";
import path from "path";
import authRoutes from "./routes/v1/auth.route";
import { swaggerDocs } from "./config";

const app: Express = express();
const allowlist = ["http://localhost:3000", process.env.FRONT_END_URL];
Expand Down
29 changes: 3 additions & 26 deletions src/routes/v1/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,9 @@ const authRoutes = express.Router();
/**
* @swagger
* components:
* tags:
* name: Auth
* description: The auth managing API
* x-displayName: Auth
* /register:
* post:
* tags:
* - Auth
* summary: Register a new user
* description: Register a new user
* operationId: register
* requestBody:
* description: User object that needs to be added to the store
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/User'
* responses:
* 200:
* description: User created successfully
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/User'
* 400:
* description: Invalid input
* schemas:
* User:
* type: object
*/
authRoutes.post(
"/register",
Expand Down
17 changes: 17 additions & 0 deletions src/routes/v1/cart.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ import { isAuthenticated } from "../../middlewares";

const cartRoute = express.Router();

/**
* @swagger
* components:
* tags:
* name: Cart
* description: The cart managing API
* x-displayName: Cart
* /carts/add:
* post:
* tags:
* - Cart
* summary: Add stock to cart
* description: Add stock to cart
* operationId: addStockToCart
* requestBody:
* description: Stock object that needs to be added to the cart
*/
cartRoute.post(
"/add",
isAuthenticated,
Expand Down

0 comments on commit 366d4d1

Please sign in to comment.