Compare commits
No commits in common. "58c8682376eaf341d2e9740fc5ecbb42a7964860" and "bbb36d7cb6dc52703d7726f76d85901558dc2275" have entirely different histories.
58c8682376
...
bbb36d7cb6
|
@ -1,11 +0,0 @@
|
|||
import express, { type Express } from "express";
|
||||
import bodyParser from "body-parser";
|
||||
|
||||
const app: Express = express();
|
||||
|
||||
app.use(bodyParser.urlencoded({
|
||||
extended: true
|
||||
}));
|
||||
app.use(bodyParser.json());
|
||||
|
||||
export { app };
|
|
@ -1,7 +1,6 @@
|
|||
import { fetchFromJellyfinApi } from "./jellyfinApiHelper.ts";
|
||||
import { saveJsonToDisk } from "./fsHelper.ts";
|
||||
import { transformItems } from "./itemHelper.ts";
|
||||
import { app } from "./expressHelper.ts";
|
||||
|
||||
interface JellyfinApiResponse {
|
||||
Items?: [],
|
||||
|
@ -16,23 +15,13 @@ const run = async () => {
|
|||
}: JellyfinApiResponse = await fetchFromJellyfinApi();
|
||||
|
||||
const transformedItems = transformItems(items);
|
||||
saveJsonToDisk({ totalItemCount, jellyfinItems: transformedItems });
|
||||
|
||||
// saveJsonToDisk({ totalItemCount, jellyfinItems: transformedItems });
|
||||
// save as something else than json lol
|
||||
|
||||
app.get("/dingle", (req, res) => {
|
||||
res.json(transformedItems)
|
||||
});
|
||||
|
||||
app.post("/bob", (req, res) => {
|
||||
const { imdbId } = req.body;
|
||||
console.log("imdbId:", imdbId);
|
||||
|
||||
res.send("OK\n");
|
||||
})
|
||||
|
||||
app.listen(1312);
|
||||
|
||||
// Add logic to endpoints
|
||||
// express API
|
||||
// GET endpoint
|
||||
// POST endpoint
|
||||
}
|
||||
|
||||
run();
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
"moduleResolution": "node",
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitAny": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowImportingTsExtensions": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue