Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
const express = require('express');
|
| 2 |
const bodyParser = require('body-parser');
|
| 3 |
-
const
|
| 4 |
-
const
|
| 5 |
|
| 6 |
const app = express();
|
| 7 |
const port = 3000;
|
|
@@ -9,25 +9,17 @@ const port = 3000;
|
|
| 9 |
// Middleware to parse JSON bodies
|
| 10 |
app.use(bodyParser.json());
|
| 11 |
|
| 12 |
-
//
|
| 13 |
-
const
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
// Initialize handlers with dependencies
|
| 19 |
-
const { searchCatalog, getMeta, getStreams } = handlers(dependencies);
|
| 20 |
|
| 21 |
// Define routes
|
| 22 |
app.get('/manifest.json', (req, res) => {
|
| 23 |
// Return the addon manifest
|
| 24 |
-
res.json(
|
| 25 |
-
id: 'stremio-addon',
|
| 26 |
-
version: '1.0.0',
|
| 27 |
-
name: 'Stremio Archive',
|
| 28 |
-
description: 'An addon for searching movies on Archive.org',
|
| 29 |
-
// other manifest fields
|
| 30 |
-
});
|
| 31 |
});
|
| 32 |
|
| 33 |
app.post('/searchCatalog', async (req, res) => {
|
|
|
|
| 1 |
const express = require('express');
|
| 2 |
const bodyParser = require('body-parser');
|
| 3 |
+
const { searchCatalog, getMeta, getStreams } = require('./handlers'); // Import the handlers
|
| 4 |
+
const addonManifest = require('./addon'); // Import the manifest
|
| 5 |
|
| 6 |
const app = express();
|
| 7 |
const port = 3000;
|
|
|
|
| 9 |
// Middleware to parse JSON bodies
|
| 10 |
app.use(bodyParser.json());
|
| 11 |
|
| 12 |
+
// Initialize the addon manifest
|
| 13 |
+
const manifest = addonManifest({
|
| 14 |
+
env: {
|
| 15 |
+
addonContentIdPrefix: 'archive-org',
|
| 16 |
+
},
|
| 17 |
+
});
|
|
|
|
|
|
|
| 18 |
|
| 19 |
// Define routes
|
| 20 |
app.get('/manifest.json', (req, res) => {
|
| 21 |
// Return the addon manifest
|
| 22 |
+
res.json(manifest);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
});
|
| 24 |
|
| 25 |
app.post('/searchCatalog', async (req, res) => {
|