Skip to content

Commit 5266623

Browse files
committed
chore: Added example ecosystem file
1 parent 9c22acf commit 5266623

File tree

4 files changed

+113
-10
lines changed

4 files changed

+113
-10
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
schema.gql
55
schema.graphql
66
.env
7+
data/
8+
tmp/logs/*
9+
710

811
# Logs
912
logs
@@ -37,3 +40,5 @@ lerna-debug.log*
3740
!.vscode/extensions.json
3841
.idea
3942
/downloads
43+
44+
ecosystem.config.js

apps/graphql-api/src/bookmarks/bookmarks.service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export class BookmarksService {
2525
...shows
2626
]
2727
.sort((itemA, itemB) => {
28+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
29+
// @ts-ignore
2830
const itemACompare = itemA?.latestEpisodeAired ?? itemA.bookmarkedOn
31+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
32+
// @ts-ignore
2933
const itemBCompare = itemB?.latestEpisodeAired ?? itemB.bookmarkedOn
3034

3135
return itemBCompare - itemACompare

ecosystem.config.example.js

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
const logsDir = process.cwd() + 'tmp/logs'
2+
3+
const sharedEnv = {
4+
NODE_ENV: 'production',
5+
6+
GRAPHQL_PORT: 5000,
7+
8+
SCRAPER_PORT: 5001,
9+
10+
// The name of the MongoDB database
11+
MONGO_DATABASE: 'popcorn-api',
12+
13+
// The URI to the MongoDB database.
14+
MONGO_URI: '127.0.0.1',
15+
16+
// The port of the MongoDB database.
17+
MONGO_PORT: '27017',
18+
19+
// The username of the MongoDB database, disable if none.
20+
// MONGO_USER: '',
21+
22+
// The password of the MongoDB database, disable if none.
23+
// MONGO_PASS: '',
24+
25+
// Location where to download everything in, make sure this location exists
26+
// Also must be a absolute path
27+
DOWNLOAD_LOCATION: '',
28+
29+
// Username of your opensubtitles account
30+
// OPENSUBTITLES_USERNAME: '',
31+
32+
// Password of your opensubtitles account
33+
// OPENSUBTITLES_PASSWORD: '',
34+
35+
// API key for Fanart, get one here: https://fanart.tv/get-an-api-key/
36+
FANART_KEY: '',
37+
38+
// API key for Omdb, get one here: http://www.omdbapi.com/apikey.aspx
39+
OMDB_KEY: '',
40+
41+
// API key for Tmdb, get one here: https://www.themoviedb.org/settings/api/new/form?type=developer
42+
TMDB_KEY: '',
43+
44+
// API key for Trakt, get one here: https://trakt.tv/oauth/applications/new (Use the client id)
45+
TRAKT_KEY: '',
46+
47+
// API key for Tvdb, get one here: https://www.thetvdb.com/member/api
48+
TVDB_KEY: '',
49+
}
50+
51+
module.exports = {
52+
apps: [
53+
{
54+
name: 'GraphQL API',
55+
script: 'dist/apps/graphql-api/main.js',
56+
instances: 1,
57+
max_restarts: 5,
58+
autorestart: true,
59+
watch: false,
60+
error_file: `${logsDir}/graphql-api/error.log`,
61+
out_file: `${logsDir}/graphql-api/out.log`,
62+
log_file: null,
63+
env: sharedEnv
64+
},
65+
{
66+
name: 'Scraper',
67+
script: 'dist/apps/scraper/main.js',
68+
args: '-m pretty',
69+
instances: 1,
70+
max_restarts: 5,
71+
autorestart: true,
72+
watch: false,
73+
error_file: `${logsDir}/scraper/error.log`,
74+
out_file: `${logsDir}/scraper/out.log`,
75+
log_file: null,
76+
env: {
77+
...sharedEnv,
78+
79+
// The time between cronjobs.
80+
CRON_TIME: '0 0 */6 * * *',
81+
82+
// The location of the temporary directory for the logs.
83+
TEMP_DIR: `${logsDir}/`,
84+
},
85+
},
86+
// Enable this if you want auto updates
87+
// {
88+
// name: 'Updater',
89+
// cwd: 'updater',
90+
// script: 'dist/updater.js',
91+
// instances: 1,
92+
// max_restarts: 5,
93+
// autorestart: true,
94+
// watch: false,
95+
// error_file: `${logsDir}/updater.log`,
96+
// out_file: `${logsDir}/updater.log`,
97+
// log_file: null,
98+
// env: {
99+
// // The time between cronjobs.
100+
// CRON_TIME: '0 0 * * *',
101+
// },
102+
// },
103+
],
104+
}

tmp/apps/graphql-api/tsconfig.generated.json

-10
This file was deleted.

0 commit comments

Comments
 (0)