Skip to content

Commit

Permalink
Merge branch 'release/1.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
PofMagicfingers committed Jan 30, 2018
2 parents 6d3f00a + ecab1c8 commit fda3b30
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 78 deletions.
28 changes: 11 additions & 17 deletions app.js
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)
5 changes: 1 addition & 4 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"listen": 8880,
"stats": {
"bin": "~/podcloud/stats/bin/stats",
"private_key": "~/podcloud/keys/rss.key"
},
"mongodb": "mongodb://localhost/podcloud_development",
"hosts": {
"podcasts": "lepodcast.test",
"platform": "podcloud.test",
Expand Down
5 changes: 1 addition & 4 deletions config/preprod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"listen": "/tmp/podcloud.rss.preprod.sock",
"stats": {
"bin": "/home/podcloud/preprod/stats/current/bin/stats",
"private_key": "/home/podcloud/preprod/rss/shared/keys/rss.key"
},
"mongodb": "mongodb://localhost/podcloud_beta",
"hosts": {
"podcasts": "pp.lepodcast.fr",
"platform": "pp.podcloud.fr",
Expand Down
5 changes: 1 addition & 4 deletions config/production.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"listen": "/tmp/podcloud.rss.production.sock",
"stats": {
"bin": "/home/podcloud/production/stats/current/bin/stats",
"private_key": "/home/podcloud/production/rss/shared/keys/rss.key"
},
"mongodb": "mongodb://localhost/podcloud",
"hosts": {
"podcasts": "lepodcast.fr",
"platform": "podcloud.fr",
Expand Down
Loading

0 comments on commit fda3b30

Please sign in to comment.