-
Notifications
You must be signed in to change notification settings - Fork 30
How to use
Davenchy edited this page Jan 7, 2020
·
4 revisions
Note: you can use .env file to setup vars
Var | Default | Desc |
---|---|---|
PORT | 3000 | server listening port |
OSUA | TemporaryUserAgent | Opensubtitles.org User Agent |
for more information about the OpenSubtitles.org api user agent from here
-
Install dependencies
npm install
-
Start the server
npm start
-
Or you can env vars
PORT=3000 OSUA=SOME_USER_AGENT npm start
-
Install dependencies
npm install -D
-
Then start the dev server
npm run dev
Note: The same env vars are applied
const app = require("express")();
const liveTorrentBackend = require("live-torrent-backend");
app.use(liveTorrentBackend());
app.listen(3000, () => console.log("server is running on port 3000"));
Note: The same OSUA env var is applied
- by default the server using the next middle wares:
. cors
. morgan
. body-parser
- Note you can display them by the next line of code:
app.use(liveTorrentBackend(true));