randydev commited on
Commit
a6fbcb7
·
verified ·
1 Parent(s): 56ddde0

Create hentai.js

Browse files
Files changed (1) hide show
  1. plugins/hentai.js +18 -0
plugins/hentai.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import express from 'express';
2
+ import { AnimeHentai } from '../scrapper.js';
3
+ const HentaiRoutes = express.Router();
4
+
5
+ HentaiRoutes.get('/api/v1/hentai-anime', async (req, res) => {
6
+ try {
7
+ const result = await AnimeHentai();
8
+ if (result) {
9
+ res.json({ result });
10
+ } else {
11
+ res.status(404).json({ error: "No result found." });
12
+ }
13
+ } catch (error) {
14
+ res.status(500).json({ error: error.message });
15
+ }
16
+ });
17
+
18
+ export { HentaiRoutes };