Ruloaooa commited on
Commit
4319df5
·
verified ·
1 Parent(s): 53cf329

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +28 -1
index.js CHANGED
@@ -134,7 +134,34 @@ async function createCustomSWGenerator({ profileImage, mainImage, caption = "Cus
134
  */
135
 
136
  app.get('*', (req, res) => {
137
- res.json('hi!');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  });
139
 
140
  app.post('/generate', async (req, res) => {
 
134
  */
135
 
136
  app.get('*', (req, res) => {
137
+ const documentation = {
138
+ description: 'Express.js API documentation for generating image status WhatsApp using canvas',
139
+ endpoints: [
140
+ {
141
+ method: 'POST',
142
+ path: '/generate',
143
+ description: 'Generate a new status with profile image, main image, caption, and views.',
144
+ requestBody: {
145
+ profileImage: 'URL to the profile image',
146
+ mainImage: 'URL to the main image',
147
+ caption: 'Caption for the status',
148
+ views: 'Number of views (integer)',
149
+ },
150
+ exampleRequest: {
151
+ profileImage: './profile-image.jpg',
152
+ mainImage: './main-image.jpg',
153
+ caption: 'this is the caption!',
154
+ views: 10,
155
+ },
156
+ response: {
157
+ status: 'success',
158
+ ContentType: 'image/png'
159
+ },
160
+ },
161
+ ],
162
+ };
163
+
164
+ res.json(documentation);
165
  });
166
 
167
  app.post('/generate', async (req, res) => {