mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add getJsonDirectory helper
This commit is contained in:
parent
7be3c23efb
commit
f1750ef4aa
2 changed files with 30 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { promises as fs } from 'fs'
|
||||
|
||||
import Layout from '@/components/layout/default.js'
|
||||
import { getJsonDirectory } from '@/helpers/get-json-directory.js';
|
||||
|
||||
// Based on
|
||||
// https://github.com/lfades/static-tweet/blob/b2a1044d881cca88e7761491d4f22c8908497d92/pages/t/%5Btweet%5D.js
|
||||
|
|
@ -54,6 +55,10 @@ export async function getStaticProps({ params }) {
|
|||
const server = await fs.readdir('./.next/server')
|
||||
const chunks = await fs.readdir('./.next/server/chunks')
|
||||
const staticDirectory = await fs.readdir('./.next/server/chunks/static')
|
||||
const jsonDirectory = await getJsonDirectory()
|
||||
|
||||
|
||||
console.log('jsonDirectory', jsonDirectory)
|
||||
|
||||
// console.log('endpointListings', endpointListings[0])
|
||||
|
||||
|
|
@ -63,7 +68,8 @@ export async function getStaticProps({ params }) {
|
|||
dotnext,
|
||||
server,
|
||||
chunks,
|
||||
staticDirectory
|
||||
staticDirectory,
|
||||
jsonDirectory
|
||||
}
|
||||
|
||||
const start = '/formula/'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue