Skip to content

Commit

Permalink
Revert "stats: try to fix reading pixel.gif"
Browse files Browse the repository at this point in the history
This reverts commit 8f0dda5.
  • Loading branch information
mimecuvalo committed Mar 3, 2023
1 parent 8f0dda5 commit 3aa20b7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ const nextConfig = {
hideSourceMaps: true,
},

// Used to allow /api/stats on Vercel to work
serverRuntimeConfig: {
PROJECT_ROOT: __dirname,
},

async redirects() {
return [
{
Expand Down
1 change: 0 additions & 1 deletion pages/api/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { User } from '@prisma/client';
import crypto from 'crypto';
import { follow } from 'social-butterfly/activitystreams';
import magic from 'magic-signatures';
import prisma from 'data/prisma';

// TODO(mime): all this user creation logic has to go somewhere else so we can reuse it later.
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
Expand Down
6 changes: 1 addition & 5 deletions pages/api/stats.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { NextApiRequest, NextApiResponse } from 'next';

import fs from 'fs';
import getConfig from 'next/config';
import { isRobotViewing } from 'util/crawler';
import { parseContentUrl } from 'util/url-factory';
import path from 'path';
import prisma from 'data/prisma';

const { serverRuntimeConfig } = getConfig();

const filePath = path.join(serverRuntimeConfig.PROJECT_ROOT, 'public/img/pixel.gif');
const filePath = path.resolve(process.cwd(), 'public/img/pixel.gif');
const pixelImageBuffer = fs.readFileSync(filePath);

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
Expand Down

0 comments on commit 3aa20b7

Please sign in to comment.