Skip to content

Commit

Permalink
faststore-poc(SFS-1709): test custom server
Browse files Browse the repository at this point in the history
  • Loading branch information
biancasilvavtex committed Oct 30, 2024
1 parent a6d471d commit 7ca9614
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/core/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const http = require('http')
const url = require('url')
const NextServer = require('next/dist/server/next-server').default
const { config } = require('./.next/required-server-files.json')
const pinoLogger = require('pino')
const { parse } = require('url')

// eslint-disable-next-line turbo/no-undeclared-env-vars
Expand All @@ -24,20 +23,13 @@ const app = new NextServer({

const handle = app.getRequestHandler()

const getLogger = () => {
return pinoLogger({
level: 'debug', // TODO: define by env
})
}
let logger = getLogger()

app.prepare().then(() => {
http
.createServer((req, res) => {
let startTime = Date.now()
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl).then(() => {
logger.info({
console.log({
url: req.url,
method: req.method,
headers: req.headers,
Expand Down

0 comments on commit 7ca9614

Please sign in to comment.