Skip to content

Commit

Permalink
feat: getServerSidePropsFunctions 함수 _getPageFiles적용
Browse files Browse the repository at this point in the history
  • Loading branch information
d0422 committed Jun 3, 2024
1 parent 7211950 commit ea3d24b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
24 changes: 0 additions & 24 deletions apps/miniNext/src/core/findServerSideProps.ts

This file was deleted.

15 changes: 15 additions & 0 deletions apps/miniNext/src/core/getServerSidePropsFunction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import path from 'path';
import { _getPagesFiles } from './getPagesFiles';

type ServerSideFunction = Record<string, Function>;

export const getServerSidePropsFunction = async () => {
const result: ServerSideFunction = {};

const files = await _getPagesFiles();
files.map((file) => {
const { getServerSideProps } = require(path.resolve(file));
result[file] = getServerSideProps;
});
return result;
};

0 comments on commit ea3d24b

Please sign in to comment.