Revert "fix: support ipv6 for nextjs"

This reverts commit f9de6671e0aa29e25e872a80aa334d3319e3e522.
This commit is contained in:
Thanh Vu
2023-06-02 14:01:40 +07:00
committed by Thanh Vu
parent db99bf3674
commit c41007e026
3 changed files with 2 additions and 35 deletions

View File

@@ -4,8 +4,8 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && tsc --project tsconfig.server.json",
"start": "node dist/index.js",
"build": "next build",
"start": "next start",
"lint": "next lint",
"db-studio": "prisma db studio",
"stripe:listen": "stripe listen --forward-to localhost:3000/api/stripe/webhook"

View File

@@ -1,22 +0,0 @@
import { createServer } from 'http';
import next from 'next';
import { parse } from 'url';
const hostname = process.env.HOST || '[::]';
const port = parseInt(process.env.PORT || '3000', 10);
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev, hostname, port });
const handle = app.getRequestHandler();
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url!, true)
handle(req, res, parsedUrl)
}).listen(port);
// eslint-disable-next-line no-console
console.log(
`> Server listening at http://${hostname}:${port} as ${dev ? 'development' : process.env.NODE_ENV
}`
);
});

View File

@@ -1,11 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "es2017",
"isolatedModules": false,
"noEmit": false
},
"include": ["server/**/*.ts"]
}