-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
136 lines (130 loc) · 3.04 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
const express = require("express");
const router = express.Router();
const NotionController = require("./services/notion");
/**
* @swagger
* /api/v1/create/post:
* post:
* tags:
* - Blog Post
* name: Create Blog Post
* summary: Request to create blog post
* consumes:
* - application/json
* produces:
* - application/json
* parameters:
* - name: body
* in: body
* schema:
* type: object
* properties:
* title:
* type: string
* tags:
* type: array
* items:
* type: string
* content:
* type: string
* author:
* type: string
* required:
* - title
* - tags
* - content
* - author
* responses:
* 201:
* description: Blog Post created successfully
* 400:
* description: Bad request
* 500:
* description: Internal server error
*/
// create database
router.post("/create/post", NotionController.createBlogPost);
/**
* @swagger
* /api/v1/blog/posts:
* get:
* tags:
* - Blog Post
* name: Blog Posts
* summary: Request to retrieve all blog posts
* consumes:
* - application/json
* produces:
* - application/json
* responses:
* 200:
* description: Blog Posts Object
* 400:
* description: Bad request
* 500:
* description: Internal server error
*/
// blog posts
router.get("/blog/posts", NotionController.blogPosts);
/**
* @swagger
* /api/v1/blog/{id}:
* get:
* tags:
* - Blog Post
* name: Blog post details
* summary: Get blog post details
* produces:
* - application/json
* consumes:
* - application/json
* parameters:
* - in: path
* name: id
* schema:
* type: integer
* required:
* - id
* responses:
* 200:
* description: Blog post object
* 400:
* description: Bad Request
* 500:
* description: Internal server error
*/
// blog post details
router.get("/blog/:id", NotionController.blogInfo);
/**
* @swagger
* /api/v1/blog/search:
* post:
* tags:
* - Blog Post
* name: Search Blog Post
* summary: Search for blog post
* consumes:
* - application/json
* produces:
* - application/json
* parameters:
* - name: body
* in: body
* schema:
* type: object
* properties:
* search:
* type: string
* required:
* - search
* responses:
* 200:
* description: Blog Post Object
* 400:
* description: Bad request
* 500:
* description: Internal server error
*/
// search posts
router.post("/blog/search/", NotionController.searchBlogPost);
module.exports = router;