sazumiviki-api
Advanced tools
Comparing version 1.0.0 to 1.0.1
15
index.js
@@ -5,2 +5,3 @@ import express from 'express'; | ||
import { igdl } from './api/igdl.mjs'; | ||
import sswebA from './api/ssweb.mjs'; | ||
@@ -23,10 +24,14 @@ const app = express(); | ||
app.get('/api/igdl', async (req, res) => { | ||
}); | ||
app.get('/api/ssweb', async (req, res) => { | ||
try { | ||
const { url_media } = req.query; | ||
if (!url_media) { | ||
throw new Error('URL media harus disediakan'); | ||
const { url, full, type } = req.query; | ||
if (!url) { | ||
throw new Error('URL harus disediakan'); | ||
} | ||
const result = await igdl(url_media); | ||
res.json(result); | ||
const buffer = await sswebA(url, full, type); | ||
res.setHeader('Content-Type', 'image/png'); | ||
res.send(buffer); | ||
} catch (error) { | ||
@@ -33,0 +38,0 @@ res.status(500).json({ error: error.message }); |
{ | ||
"name": "sazumiviki-api", | ||
"version": "1.0.0", | ||
"description": "apis", | ||
"version": "1.0.1", | ||
"description": "sazumiviki-api adalah salah satu modul yang membuat kode Anda bekerja dengan mudah, sehingga Anda dapat menghasilkan apa yang Anda inginkan dengan mudah", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9378
7
205