Skip to content

Commit

Permalink
remove express.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rkamysz committed Jul 25, 2023
1 parent 959b121 commit f1bc6b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 437 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This package encapsulates the core mechanism, however, complete functionality re
- [@alien-worlds/workers](https://github.com/Alien-Worlds/workers)
- [async](https://github.com/caolan/async)
- [commander](https://github.com/tj/commander.js)
- [express](https://github.com/expressjs/express)


## Table of Contents
Expand Down Expand Up @@ -53,7 +52,7 @@ All processes utilize the commander, enabling specific value assignments for ind

### API

The API process, currently under development, is intended to provide easy access to downloaded data. This Express.js-based API allows viewing of blockchain data, offering endpoints to retrieve block-specific data, transactions, tables, or data from a specific range according to selected criteria. The API is read-only, it doesn't contain methods that modify the content.
The API process, currently under development, is intended to provide easy access to downloaded data. This API allows viewing of blockchain data, offering endpoints to retrieve block-specific data, transactions, tables, or data from a specific range according to selected criteria. The API is read-only, it doesn't contain methods that modify the content.

### Broadcasting

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
},
"license": "ISC",
"devDependencies": {
"@types/express": "^4.17.17",
"@types/jest": "^27.0.3",
"@types/node": "^18.7.14",
"@types/node-fetch": "2.x",
Expand All @@ -42,7 +41,6 @@
"async": "^3.2.4",
"commander": "^10.0.1",
"crypto": "^1.0.1",
"express": "^4.18.2",
"ts-node": "^10.9.1"
}
}
21 changes: 8 additions & 13 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { log, Route } from '@alien-worlds/api-core';
import express, { Express } from 'express';
import { ApiConfig } from './api.types';

export class Api {
private app: Express;
export class Api<WebFramework> {
private app: WebFramework;

constructor(private config: ApiConfig) {
this.app = express();
}
constructor(private config: ApiConfig) {}

public async start() {
const {
config: { port },
} = this;
this.app.listen(port, () => {
log(`Server is running at http://localhost:${port}`);
});
throw new Error('Method "start" not implemented');
}

public get framework(): WebFramework {
return this.app;
}
}
Loading

0 comments on commit f1bc6b8

Please sign in to comment.