-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
273 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import Server from "~/Server" | ||
import config from "config" | ||
import { Mongo } from "podcloud-stats" | ||
|
||
function constructFeedsAPIUrl() { | ||
const host = config.get("hosts") && config.get("hosts").feeds | ||
const feeds_host = config.get("hosts") && config.get("hosts").feeds | ||
|
||
return ( | ||
(host && | ||
(host.match(/^https?:\/\//) ? host : "http://" + host) + "/graphql") || | ||
null | ||
) | ||
} | ||
const feedsAPIURL = | ||
(feeds_host && | ||
(feeds_host.match(/^https?:\/\//) ? feeds_host : "http://" + feeds_host) + | ||
"/graphql") || | ||
null | ||
|
||
const stats = config.get("stats") | ||
|
||
const server = new Server( | ||
config.get("listen"), | ||
constructFeedsAPIUrl(), | ||
stats.private_key, | ||
stats.bin | ||
) | ||
server.start() | ||
Mongo.connect(config.get("mongodb")).then(() => { | ||
const server = new Server(config.get("listen"), feedsAPIURL) | ||
server.start() | ||
}, console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.