Skip to content

Commit be6d90e

Browse files
committed
fix(local-server): メッセージのアプリ名 = ディレクトリ名を追加
1 parent b425542 commit be6d90e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/local-server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HandleFunction } from "connect";
66
import detectPort = require("detect-port");
77
import { responseLog } from "./middlewares/response-log";
88
import chalk from "chalk";
9+
910
const logSymbols = require("log-symbols");
1011

1112
export interface LocalServerOptions {
@@ -29,15 +30,17 @@ export class LocalServer {
2930
console.log(
3031
`${logSymbols.warning} ポート番号:${
3132
this.port
32-
}はすでに使われています。別の利用できるポート番号を探索中…`
33+
}はすでに使われています。利用できる別のポート番号を探索中です。`
3334
);
3435
}
3536
const serve = serveStatic(this.rootDir, { index: ["index.html", "index.htm"] }) as HandleFunction;
3637
this.server = connect()
3738
.use(responseLog())
3839
.use(serve)
39-
.listen(newPort, function() {
40+
.listen(newPort, () => {
41+
const appName = path.basename(this.rootDir) || "app";
4042
console.log(`
43+
${chalk.underline(appName)}のローカルサーバを起動しました。
4144
次のURLをブラウザで開いてください。
4245
4346
URL: ${chalk.underline(`http://localhost:${newPort}`)}

0 commit comments

Comments
 (0)