Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
curly210102 committed Nov 4, 2021
1 parent ed63ad7 commit 16aaee8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pages/api/hello.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import type { NextApiRequest, NextApiResponse } from "next";

import { join, resolve } from "path";
import fs from "fs";

const extensionDirectory = resolve(process.cwd(), "extensions");
import { readFileSync } from "fs";

type Data = {
content: string;
Expand All @@ -20,8 +18,8 @@ export default function handler(
) {
if (req.method === "GET") {
const { slug } = req.query;

const ext = fs.readFileSync(
const extensionDirectory = resolve(process.cwd(), "extensions");
const ext = readFileSync(
join(
extensionDirectory,
Array.isArray(slug) ? slug[0] : slug,
Expand Down

0 comments on commit 16aaee8

Please sign in to comment.