2021年10月17日日曜日

クロニクル .NET Core ASP.NET Core Web Helloworldを直してみる

1.Startup.cs の修正



public void Configure

を、以下のように修正します

 endpoints.MapGet("/", async context =>
 {
      // await context.Response.WriteAsync("Hello World!");
      context.Response.ContentType = "text/html" ;
      await context.Response.WriteAsync("<html><body><h1>hello!</h1></body></html>") ;
                    
 });

2.実行すると


h1で

hello!

が表示されます


0 件のコメント:

コメントを投稿

Gitを用いた開発の流れ

Gitを用いた開発の流れ 1.Clone 共有リポジトリから、ローカルへコピー 2.ファイル編集 3.add 編集したファイルをcommit対象として登録 4.commit ローカルリポジトリへ反映 5.push ローカルリポジトリから、共有リポジトリへ...