Ruloaooa commited on
Commit
1f2ed94
·
verified ·
1 Parent(s): 9af3c03

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +24 -3
index.js CHANGED
@@ -241,8 +241,8 @@ app.get('*', (req, res) => {
241
  views: 'Number of views (integer)',
242
  },
243
  exampleRequest: {
244
- profileImage: './profile-image.jpg',
245
- mainImage: './main-image.jpg',
246
  caption: 'this is the caption!',
247
  views: 10,
248
  },
@@ -251,6 +251,27 @@ app.get('*', (req, res) => {
251
  ContentType: 'image/png'
252
  },
253
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  ],
255
  };
256
 
@@ -276,7 +297,7 @@ app.post('/generate', async (req, res) => {
276
 
277
  app.post('/generate2', async (req, res) => {
278
  try {
279
- const { username, avatar, text } = req.body;
280
 
281
  // Validasi input
282
  if (!username || !text || !avatar) {
 
241
  views: 'Number of views (integer)',
242
  },
243
  exampleRequest: {
244
+ profileImage: 'https://example.com/image.jpg',
245
+ mainImage: 'https://example.com/image2.jpg',
246
  caption: 'this is the caption!',
247
  views: 10,
248
  },
 
251
  ContentType: 'image/png'
252
  },
253
  },
254
+ {
255
+ method: 'POST',
256
+ path: '/generate2',
257
+ description: 'Generate treads comments with avatar, username, text, and countLike.',
258
+ requestBody: {
259
+ avatar: 'URL to the profile image',
260
+ username: 'username for profile',
261
+ text: 'main text',
262
+ countLike: 'total like count',
263
+ },
264
+ exampleRequest: {
265
+ avatar: 'https://example.com/image.jpg',
266
+ username: '4rlzyy',
267
+ text: 'this is the main text!',
268
+ countLike: 10,
269
+ },
270
+ response: {
271
+ status: 'success',
272
+ ContentType: 'image/png'
273
+ },
274
+ },
275
  ],
276
  };
277
 
 
297
 
298
  app.post('/generate2', async (req, res) => {
299
  try {
300
+ const { username, avatar, text, countLike } = req.body;
301
 
302
  // Validasi input
303
  if (!username || !text || !avatar) {