Skip to content

Commit

Permalink
fix: configured rest api settings (#221)
Browse files Browse the repository at this point in the history
* fix: config rest api

* fix: update jest config

* fix: jest types

* fix: update pnpm lock

* fix: deleted package-lock
  • Loading branch information
JasonNotJson authored Nov 11, 2022
1 parent 5bdd0e7 commit fb24be9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15,391 deletions.
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Config } from '@jest/types';
import { Config } from '@jest/types';

const config: Config.InitialOptions = {
rootDir: '.',
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
moduleDirectories: ['<rootDir>/node_modules'],
};

export default config;
4 changes: 3 additions & 1 deletion lib/constructs/business/rest-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,12 @@ export class TimetableApiService extends RestApiService {
// timetableFunctions.exportFunction, {proxy: true},
// );

// , apigw2.HttpMethod.DELETE

const optionsTimetable = root.addCorsPreflight({
allowOrigins: allowOrigins,
allowHeaders: allowHeaders,
allowMethods: [apigw2.HttpMethod.GET, apigw2.HttpMethod.POST, apigw2.HttpMethod.PATCH, apigw2.HttpMethod.OPTIONS, apigw2.HttpMethod.DELETE],
allowMethods: [apigw2.HttpMethod.GET, apigw2.HttpMethod.PUT, apigw2.HttpMethod.POST, apigw2.HttpMethod.PATCH, apigw2.HttpMethod.OPTIONS],
});
const getTimetable = root.addMethod(apigw2.HttpMethod.GET, getIntegration, {
operationName: 'GetTimetable',
Expand Down
Loading

0 comments on commit fb24be9

Please sign in to comment.