Skip to content

Commit

Permalink
feat: add definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
martin.mueller committed Nov 24, 2020
1 parent 1392402 commit 37ac17a
Show file tree
Hide file tree
Showing 10 changed files with 901 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const project = new AwsCdkConstructLibrary({
cdkVersion: "1.74.0",
name: "cdk-alps-spec-rest-api",
repository: "https://github.com/mmuller88/cdk-alps-spec-rest-api.git",
dependencies: {
'unified':'https://github.com/mamund/alps-unified',
},
cdkDependencies: [
'@aws-cdk/core',
'@aws-cdk/aws-apigateway',
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
"settings": {},
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.trailingComma": true,
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ CDK Construct library constructed with the help of Pahud https://www.youtube.com

# ALPS

https://github.com/mamund/alps-unified

# Sample

```ts
Expand All @@ -17,3 +19,9 @@ const stack = new cdk.Stack(app, 'my-demo-stack', { env });

new AlpsSpecRestApi(stack, 'AlpsSpecRestApi');
```

# Deploy the CDK stack

```ts
npx cdk --app lib/integ.default.js --profile damadden88 deploy
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
},
"dependencies": {
"@aws-cdk/aws-apigateway": "^1.74.0",
"@aws-cdk/core": "^1.74.0"
"@aws-cdk/core": "^1.74.0",
"unified": "https://github.com/mamund/alps-unified"
},
"bundledDependencies": [],
"keywords": [
Expand Down
22 changes: 12 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import * as apigw from '@aws-cdk/aws-apigateway';
import * as cdk from '@aws-cdk/core';
// import * as lambda from "@aws-cdk/aws-apigateway";
import { join } from 'path';

export interface AlpsSpecRestApiProps {}

export class AlpsSpecRestApi extends cdk.Construct {
constructor(
scope: cdk.Construct,
id: string,
props: AlpsSpecRestApiProps = {},
) {
constructor(scope: cdk.Construct, id: string, props?: AlpsSpecRestApiProps) {
super(scope, id);
props;

const api = new apigw.RestApi(this, 'RestApi', {
restApiName: 'Alps Rest Api Gw',
});
// const uni = unified;
const swaggerFile = 'src/todo-oas.yaml';
//const swaggerFile = 'src/openapi.yaml';

api.root.addMethod('ANY');
const api = new apigw.SpecRestApi(this, 'SpecRestApi', {
// restApiName: 'Alps Rest Api Gw',
apiDefinition: apigw.ApiDefinition.fromAsset(
join(__dirname, `../${swaggerFile}`),
),
});
api;
}
}
Loading

0 comments on commit 37ac17a

Please sign in to comment.