improve types
This commit is contained in:
parent
d59f3bd6d7
commit
f3062b74fe
2 changed files with 4 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import type { AstroUserConfig } from 'astro/config';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import http from 'node:http';
|
import http from 'node:http';
|
||||||
|
@ -24,7 +25,7 @@ function parsePathname(pathname: string, host: string | undefined, port: number)
|
||||||
export function createServer(
|
export function createServer(
|
||||||
{ client, port, host, removeBase }: CreateServerOptions,
|
{ client, port, host, removeBase }: CreateServerOptions,
|
||||||
handler: http.RequestListener,
|
handler: http.RequestListener,
|
||||||
trailingSlash: string
|
trailingSlash: AstroUserConfig['trailingSlash']
|
||||||
) {
|
) {
|
||||||
const listener: http.RequestListener = (req, res) => {
|
const listener: http.RequestListener = (req, res) => {
|
||||||
if (req.url) {
|
if (req.url) {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { AstroUserConfig } from 'astro/config';
|
||||||
import { IncomingMessage, ServerResponse } from 'node:http';
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
||||||
|
|
||||||
export interface UserOptions {
|
export interface UserOptions {
|
||||||
|
@ -15,7 +16,7 @@ export interface Options extends UserOptions {
|
||||||
port: number;
|
port: number;
|
||||||
server: string;
|
server: string;
|
||||||
client: string;
|
client: string;
|
||||||
trailingSlash: string;
|
trailingSlash: AstroUserConfig['trailingSlash'];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RequestHandlerParams = [
|
export type RequestHandlerParams = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue