-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
100 additions
and
89 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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import 'cross-fetch/polyfill'; | ||
import "reflect-metadata"; | ||
import "dotenv/config"; | ||
|
||
import { OrderRatingResolver, OrderResolver } from './order'; | ||
import { RoadmanBuild, log, roadman } from "roadman"; | ||
import { | ||
TransactionDefaultResolver, | ||
btcpayserverRoadman, | ||
getWalletResolvers, | ||
moneroserverRoadman, | ||
} from "@roadmanjs/wallet"; | ||
import { WithdrawRequestAdminResolver, WithdrawRequestResolver } from './withdrawRequest'; | ||
import { get as _get, isEmpty } from "lodash"; | ||
|
||
import AdCategoryResolver from "./listing/AdCategory.resolver"; | ||
import { AdsListingResolver } from './listing/AdsListing.model'; | ||
import { BadgeResolver } from './badge/Badge.resolver'; | ||
import CountryResolver from './country/Country.resolver'; | ||
import { NotificationResolver } from './notification'; | ||
import PgpResolver from './auth/Pgp.resolver'; | ||
import SettingsResolver from './settings/settings.resolver'; | ||
import UserAuthPwResolver from './auth/User.resolver.pw'; | ||
import UserAuthResolver from './auth/User.resolver.auth'; | ||
import VendorResolver from './vendor/vendor.resolver'; | ||
import { couchsetRoadman } from "@roadmanjs/couchset"; | ||
import { createDefaultIndexes } from './_startup'; | ||
import { getAdListingResolvers } from "./listing"; | ||
import { getAuthResolvers } from "@roadmanjs/auth"; | ||
import { getChatResolvers } from "@roadmanjs/chat"; | ||
import { getSocialResolvers } from "@roadmanjs/social"; | ||
import { mediaRoadman } from './media/media.app'; | ||
import { DisputeAdminResolver, DisputesResolver } from './disputes'; | ||
import AdminSettingsResolver from './settings/settings.resolver.admin'; | ||
import { initSiteSettings } from './_config/site'; | ||
import { getSiteSettings } from './settings/settings.methods'; | ||
|
||
const resolvers = [ | ||
...getAuthResolvers(), | ||
...getChatResolvers(), | ||
...getSocialResolvers(), | ||
...getWalletResolvers(), | ||
...getAdListingResolvers(), | ||
AdsListingResolver, | ||
OrderResolver, | ||
OrderRatingResolver, | ||
WithdrawRequestResolver, | ||
WithdrawRequestAdminResolver, | ||
AdCategoryResolver, | ||
CountryResolver, | ||
VendorResolver, | ||
SettingsResolver, | ||
AdminSettingsResolver, | ||
TransactionDefaultResolver, | ||
PgpResolver, UserAuthResolver, UserAuthPwResolver, NotificationResolver, BadgeResolver, DisputeAdminResolver, DisputesResolver | ||
]; | ||
|
||
const app = async (args: RoadmanBuild): Promise<RoadmanBuild> => { | ||
const { app } = args; | ||
|
||
app.get("/client/settings", async (req, res) => { | ||
const siteSettings = await getSiteSettings(true); | ||
const settings = siteSettings ? siteSettings : initSiteSettings; | ||
res.json(settings); | ||
}); | ||
|
||
return args; | ||
} | ||
|
||
const run = async () => { | ||
|
||
const roadmanStarted = await roadman({ | ||
roadmen: [ | ||
app, | ||
mediaRoadman, | ||
couchsetRoadman, | ||
btcpayserverRoadman, moneroserverRoadman, | ||
], | ||
resolvers, | ||
}); | ||
|
||
if (roadmanStarted) { | ||
if (!isEmpty(process.env.STARTUP)) { | ||
log("startup", "running startup"); | ||
setTimeout(async () => { | ||
log("roadmanStarted", roadmanStarted); | ||
await createDefaultIndexes(); | ||
}, 3000); | ||
} | ||
} | ||
}; | ||
|
||
run(); |
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