Created
April 23, 2021 02:18
-
-
Save Hurly77/78610beae642fd8fbea9d29296fa8b1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//we can actually import what ever node modules we want as long as we only use them in the getStaticProps method | |
import path from 'path'; | |
... | |
export const getStaticProps = async() => { | |
//proccess is a global object that can be accessed anywhere with in a node application. Because nextJS doesn't read getStaticProps as a client file we can use the process object. | |
//cwd = current working directory. and will actually view the current directory as the top level. | |
const filePath = path.join(process.cwd()) | |
return {props: { | |
products: [id: 'p1', title: 'Product 1'] | |
}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment