Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
rkamysz committed Jul 25, 2023
1 parent 0e42ca4 commit 14a5b86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/api/api.dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { Result } from '@alien-worlds/api-core';
import { DatabaseConfigBuilder, Dependencies } from '../common';
import { Api } from './api';
import { ApiConfig } from './api.types';

/**
* An abstract class representing a Api dependencies.
* @class ApiDependencies
*/
export abstract class ApiDependencies extends Dependencies {
public api: Api;

public databaseConfigBuilder: DatabaseConfigBuilder;

public abstract initialize(config: ApiConfig): Promise<Result>;
public abstract initialize(): Promise<Result>;
}
4 changes: 2 additions & 2 deletions src/api/start-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export const startApi = async (
routes: Route[] = [],
...args: string[]
) => {
const { api } = dependencies;
const { api, databaseConfigBuilder } = dependencies;
const vars = new ConfigVars();
const options = apiCommand.parse(args).opts<ApiCommandOptions>();
const config = buildApiConfig(vars, dependencies.databaseConfigBuilder, options);
const config = buildApiConfig(vars, databaseConfigBuilder, options);

api.setup(config);

Expand Down

0 comments on commit 14a5b86

Please sign in to comment.