42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
export const baseConfig = {
|
|
suwayomi: {
|
|
url: "http://suwayomi:4567",
|
|
graphqlUrl: "http://suwayomi:4567/api/graphql",
|
|
authMode: "none",
|
|
timeoutMs: 1000,
|
|
},
|
|
feed: {
|
|
title: "Manga releases",
|
|
description: "Recently fetched chapters",
|
|
link: "https://manga.example.test",
|
|
publicUrl: "https://rss.example.test/rss.xml",
|
|
itemLimit: 25,
|
|
cacheSeconds: 300,
|
|
},
|
|
};
|
|
|
|
export const chapter = {
|
|
id: 42,
|
|
name: "Chapter 12 & a half",
|
|
chapterNumber: 12.5,
|
|
scanlator: "A <Team>",
|
|
uploadDate: 1700000000000,
|
|
fetchedAt: 1700000100000,
|
|
realUrl: "https://source.example.test/chapter?x=1&y=2",
|
|
manga: {
|
|
id: 7,
|
|
title: "Example & Manga",
|
|
realUrl: "https://source.example.test/manga",
|
|
},
|
|
};
|
|
|
|
export async function listen(app) {
|
|
const server = app.listen(0, "127.0.0.1");
|
|
await new Promise((resolve) => server.once("listening", resolve));
|
|
const { port } = server.address();
|
|
return {
|
|
url: `http://127.0.0.1:${port}`,
|
|
close: () => new Promise((resolve) => server.close(resolve)),
|
|
};
|
|
}
|