Memberikan gambar henta* dan cosplay secara acak
const ecchi = require("ecchi-api");
ecchi.hentai()
.then(result => {
console.log(result);
});
const ecchi = require("ecchi-api");
ecchi.cosplay()
.then(result => {
console.log(result);
});
const ecchi = require("ecchi-api");
ecchi.donghua()
.then(result => {
console.log(result);
});
Membutuhkan npm express
dan readline
.
const express = require("express");
const ecchi = require("ecchi-api");
const readline = require("readline").createInterface({
input : process.stdin,
output : process.stdout
});
const app = express();
readline.question("Masukan port : ",port => {
app.listen(port,()=> {
console.log("Website berjalan di http://localhost:"+port);
});
readline.close();
});
app.get("/",async (req,res) => {
ecchi.hentai().then(data => {
var web = `<center>
<br><br>
<h1>Ecchi image</h1><br>
<a href="${data.url}"><img src="${data.url}" height="720px"></a><br>
</center>`;
res.send(web);
});
});
app.get("/cosplay",async (req,res) => {
ecchi.cosplay().then(data => {
var web = `<center>
<br><br>
<h1>Ecchi image</h1><br>
<a href="${data.url}"><img src="${data.url}" height="720px"></a><br>
</center>`;
res.send(web);
});
});
app.get("/donghua",async (req,res) => {
ecchi.donghua().then(data => {
var web = `<center>
<br><br>
<h1>Ecchi image</h1><br>
<a href="${data.url}"><img src="${data.url}" height="720px"></a><br>
</center>`;
res.send(web);
});
});