提交 8a326345 编写于 作者: J Javier Alcala 提交者: Tim Neutkens

Enable strict type checking on custom-server-typescript example (#7025)

上级 9281f465
......@@ -2,7 +2,7 @@ import { createServer } from 'http'
import { parse } from 'url'
import * as next from 'next'
const port = parseInt(process.env.PORT, 10) || 3000
const port = parseInt(process.env.PORT || '3000', 10)
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
......@@ -10,7 +10,7 @@ const handle = app.getRequestHandler()
app.prepare()
.then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true)
const parsedUrl = parse(req.url!, true)
const { pathname, query } = parsedUrl
if (pathname === '/a') {
......
......@@ -2,6 +2,7 @@
"compileOnSave": false,
"compilerOptions": {
"noEmit": true,
"strict": true,
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册