mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-19 08:15:08 +00:00
* Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Update the workshop with a new WORKSHOP_PATH under fabric-samples Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * missed a .git ignored directory on add Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Updates to run the workshop on the Apple M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * Build an arch-specific CC images on M1 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * empty commit - force a build Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> * revert an accidental commit that was building the top-level asset-transfer as arm64 Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com> Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
27 lines
No EOL
786 B
TypeScript
27 lines
No EOL
786 B
TypeScript
import * as express from 'express';
|
|
import * as bodyParser from 'body-parser';
|
|
import { Connection } from './connection';
|
|
import { AssetRouter } from './assets.router';
|
|
var cors = require('cors');
|
|
|
|
class App {
|
|
public app: express.Application;
|
|
public routes: AssetRouter = new AssetRouter();
|
|
constructor() {
|
|
new Connection().init();
|
|
this.app = express();
|
|
this.app.use(cors());
|
|
this.config();
|
|
this.routes.routes(this.app);
|
|
}
|
|
|
|
private config(): void {
|
|
// support application/json type post data
|
|
this.app.use(bodyParser.json());
|
|
//support application/x-www-form-urlencoded post data
|
|
this.app.use(bodyParser.urlencoded({
|
|
extended: false
|
|
}));
|
|
}
|
|
}
|
|
export default new App().app; |