Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
guiyom-e committed Oct 28, 2022
1 parent e2ec37b commit 4d58e1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/deployment/src/cdkConstruct/apiLambda/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
import { DEPENDENCY_FOLDER, RUNTIME_SETTINGS_FILE } from 'constants/paths/handlerPaths';
import { Construct } from 'constructs';
import { join } from 'path';

import { DEPENDENCY_FOLDER, RUNTIME_SETTINGS_FILE } from 'constants/paths/handlerPaths';
import { createRuntimeSettingsFile } from 'helpers/createRuntimeSettingsFile';
import {
getAPIHandlersFolder,
Expand All @@ -11,7 +13,6 @@ import {
requirePageManifest,
requireRoutesManifest,
} from 'helpers/nextImport';
import { join } from 'path';
import { createAPIRuntimeSettings } from 'runtimeSettings/api';

const API_HANDLER_NAME = 'NextJSApi';
Expand Down
5 changes: 3 additions & 2 deletions packages/deployment/src/helpers/nextImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ export const requireHandlerFromPath = (nextRoot: string): PagesManifest =>
* {
* "/api/hello": "pages/api/hello.js",
* "/api/bye": "pages/api/bye.js"
* "/api/[...slug]": "pages/api/[...slug].js",
* "/api/[id]": "pages/api/[id].js",
* }
* ```
*/
export const getNextAPIHandlers = (nextRoot: string): PagesManifest => {
const pageManifest = requirePageManifest(nextRoot);
export const getNextAPIHandlers = (pageManifest: PagesManifest): PagesManifest => {
const APIPaths = Object.keys(pageManifest).filter(path => path.startsWith(API_PATH_PREFIX));

return Object.fromEntries(APIPaths.map(path => [path, pageManifest[path] as string]));
Expand Down

0 comments on commit 4d58e1a

Please sign in to comment.