Commit 8a326345 authored by Javier Alcala's avatar Javier Alcala Committed by Tim Neutkens

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

parent 9281f465
...@@ -2,7 +2,7 @@ import { createServer } from 'http' ...@@ -2,7 +2,7 @@ import { createServer } from 'http'
import { parse } from 'url' import { parse } from 'url'
import * as next from 'next' 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 dev = process.env.NODE_ENV !== 'production'
const app = next({ dev }) const app = next({ dev })
const handle = app.getRequestHandler() const handle = app.getRequestHandler()
...@@ -10,7 +10,7 @@ const handle = app.getRequestHandler() ...@@ -10,7 +10,7 @@ const handle = app.getRequestHandler()
app.prepare() app.prepare()
.then(() => { .then(() => {
createServer((req, res) => { createServer((req, res) => {
const parsedUrl = parse(req.url, true) const parsedUrl = parse(req.url!, true)
const { pathname, query } = parsedUrl const { pathname, query } = parsedUrl
if (pathname === '/a') { if (pathname === '/a') {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"noEmit": true, "noEmit": true,
"strict": true,
"target": "esnext", "target": "esnext",
"module": "esnext", "module": "esnext",
"jsx": "preserve", "jsx": "preserve",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment