@@ -30,6 +30,9 @@ void tinyweb_start(uv_loop_t* loop, const char* ip, int port, const char* doc_ro
30
30
uv_tcp_init (_loop , & _server );
31
31
uv_tcp_bind (& _server , (const struct sockaddr * ) & addr , 0 );
32
32
uv_listen ((uv_stream_t * )& _server , 8 , tinyweb_on_connection );
33
+
34
+ puts ("Tinyweb v3 is started, listening port 8080..." );
35
+ puts ("Please access http://localhost:8080 from you web browser." );
33
36
}
34
37
35
38
static void after_uv_close_client (uv_handle_t * client ) {
@@ -180,7 +183,7 @@ static void tinyweb_on_request_get(uv_stream_t* client, const char* pathinfo, co
180
183
181
184
//request an action
182
185
if (strcmp (pathinfo , "/" ) == 0 ) {
183
- char * respone = format_http_respone ("200 OK" , "text/html" , "Welcome to tinyweb" , -1 , NULL );
186
+ char * respone = format_http_respone ("200 OK" , "text/html" , "Welcome to tinyweb. <a href=\"index.html\">index.html</a> " , -1 , NULL );
184
187
write_uv_data (client , respone , -1 , 0 , 1 );
185
188
} else if (strcmp (pathinfo , "/404" ) == 0 ) {
186
189
char * respone = format_http_respone ("404 Not Found" , "text/html" , "<h3>404 Page Not Found<h3>" , -1 , NULL );
0 commit comments