modified: src/pages/api/log.ts

master
joker 2 years ago
parent f73382e153
commit 9e55098156
  1. 6
      src/pages/api/log.ts

@ -2,15 +2,15 @@ import fs from 'fs';
import type { NextApiRequest, NextApiResponse } from 'next'; import type { NextApiRequest, NextApiResponse } from 'next';
// Путь к лог-файлу доступа Nginx // Путь к лог-файлу доступа Nginx
const logFilePath = '@../../log/access_blogbaster.log'; const logFilePath = './log/access_blogbaster.log';
console.log(logFilePath)
export default function handler( export default function handler(
req: NextApiRequest, req: NextApiRequest,
res: NextApiResponse res: NextApiResponse
) { ) {
let log: string[] = []; let log : string[] = []
// Чтение лог-файла // Чтение лог-файла
fs.readFile(logFilePath, 'utf8', (err, data) => { fs.readFile(logFilePath, 'utf8', (err, data) => {
if (err) throw err; if (err) throw err;

Loading…
Cancel
Save