File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import serveStatic = require("serve-static");
5
5
import { HandleFunction } from "connect" ;
6
6
import detectPort = require( "detect-port" ) ;
7
7
import { responseLog } from "./middlewares/response-log" ;
8
-
8
+ import chalk from "chalk" ;
9
9
const logSymbols = require ( "log-symbols" ) ;
10
10
11
11
export interface LocalServerOptions {
@@ -26,14 +26,23 @@ export class LocalServer {
26
26
start ( ) {
27
27
return detectPort ( this . port ) . then ( newPort => {
28
28
if ( this . port !== newPort ) {
29
- console . log ( `${ logSymbols . warning } Port:${ this . port } is already used. Lookup next available port.` ) ;
29
+ console . log (
30
+ `${ logSymbols . warning } ポート番号:${
31
+ this . port
32
+ } はすでに使われています。別の利用できるポート番号を探索中…`
33
+ ) ;
30
34
}
31
35
const serve = serveStatic ( this . rootDir , { index : [ "index.html" , "index.htm" ] } ) as HandleFunction ;
32
36
this . server = connect ( )
33
37
. use ( responseLog ( ) )
34
38
. use ( serve )
35
39
. listen ( newPort , function ( ) {
36
- console . log ( `${ logSymbols . info } Open http://localhost:${ newPort } ` ) ;
40
+ console . log ( `
41
+ 次のURLをブラウザで開いてください。
42
+
43
+ URL: ${ chalk . underline ( `http://localhost:${ newPort } ` ) }
44
+
45
+ ` ) ;
37
46
} ) ;
38
47
return this . server ;
39
48
} ) ;
You can’t perform that action at this time.
0 commit comments