Skip to content

Commit

Permalink
update siteConfigSetEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Apr 13, 2024
1 parent 650bdef commit e07ae03
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 35 deletions.
40 changes: 40 additions & 0 deletions src/app.monero.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// custom roadman
import 'cross-fetch/polyfill';
import "reflect-metadata";
import "dotenv/config";

import { Query, Resolver } from 'type-graphql';
import { RoadmanBuild, roadman, log } from "roadman";
import { walletRouter as moneroxWalletRouter, listenMain } from "@roadmanjs/monerox";

@Resolver()
class ExampleResolver {
@Query(() => [String], { nullable: true })
async apps(): Promise<string[]> {
// fake async in this example
return ['Apps', 'one', 'two'];
}
}

const customRoadmanApp = async (args: RoadmanBuild): Promise<RoadmanBuild> => {
const { app } = args;
app.use("/wallet", moneroxWalletRouter());
return args;
}

const run = async () => {

const roadmanStarted = await roadman({
roadmen: [
customRoadmanApp
],
resolvers: [ExampleResolver]
});

if(roadmanStarted){
await listenMain();
log("roadmanStarted", roadmanStarted);
}
};

run();
40 changes: 5 additions & 35 deletions src/monerox.app.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
// custom roadman
import 'cross-fetch/polyfill';
import "reflect-metadata";
import "dotenv/config";

import { Query, Resolver } from 'type-graphql';
import { RoadmanBuild, roadman, log } from "roadman";
import { walletRouter as moneroxWalletRouter, listenMain } from "@roadmanjs/monerox";
import { siteConfigSetEnv } from "./settings/settings.methods";

@Resolver()
class ExampleResolver {
@Query(() => [String], { nullable: true })
async apps(): Promise<string[]> {
// fake async in this example
return ['Apps', 'one', 'two'];
}
}

const customRoadmanApp = async (args: RoadmanBuild): Promise<RoadmanBuild> => {
const { app } = args;
app.use("/wallet", moneroxWalletRouter());
return args;
}
import { get as _get } from "lodash";
import { siteConfigSetEnv } from './settings/settings.methods';

const run = async () => {

await siteConfigSetEnv();

const roadmanStarted = await roadman({
roadmen: [
customRoadmanApp
],
resolvers: [ExampleResolver]
});

if(roadmanStarted){
await listenMain();
log("roadmanStarted", roadmanStarted);
}
await siteConfigSetEnv();
await import("./app.monero");
};

run();
run();

0 comments on commit e07ae03

Please sign in to comment.