{
"$type": "site.standard.document",
"canonicalUrl": "https://blog.nove-b.dev//posts/setup-server-golang-webapi",
"path": "/posts/setup-server-golang-webapi",
"publishedAt": "2023-12-03T00:00:00.000Z",
"site": "at://did:plc:2atly2y5kfyjcj5zap6pv4wd/site.standard.publication/3mmxeqr2tcb2k",
"tags": [
"api",
"go",
"サーバー"
],
"textContent": "net/httpでサーバーを立ち上げる\n\nDBと接続することはできたので、次はエンドポイント作成のためサーバーを立ち上げる。\n\nサーバーを構築する組み込みのパッケージが用意されているので、そちらを使用する。\n\nnet/http\n\nインストールの仕方がないとか思っていたけど、組み込み、つまり標準装備なので特にインストールは必要なく、importすれば使用可能だった。\n\nで、\n\n上記をmain.goに記載したうえで、$ go run src/main.goを実行する。\n\nに訪れると、\n\nが表示されている。これでサーバー立ち上げの確認ができた。",
"title": "Go LangでWebAPIを作成するために、Golangでサーバーを立ち上げる"
}