2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails APIとPostmanについて

2
Last updated at Posted at 2021-04-13

Rails APIを勉強してみる

フロントエンドはVue.jsやReactを使用してバックエンドをRails APIモードで作成するといった使い方。
SPAでアプリを作成する際に使用されている。

SPA(Single Page Application)

基本的にページは遷移しない。ページ遷移というのを画面内で表現する。
必要に応じてデータを非同期通信でサーバーに問い合わせ、
JavaScriptによってブラウザで動的に描画される。
「速度」「開発のしやすさ」「モバイルアプリ開発への適用」
と言った理由でSPAが主流になってきているとのこと。

Rails apiモード?

API専用アプリケーションを支援するRailsの機能でした

--apiとつけるとAPI仕様になる

$ rails new my_api --api

rails generateコマンドでview, helper, assetファイルは生成されなくなる。
Gemfileもview関連(coffee-rails, sass-rails等)のgemは入らない。

コントローラーはActionController::Baseの代わりにActionController::APIから継承される

class ApplicationController < ActionController::API
end

Postmanて何?

Postmanは、プロジェクトのAPIを検証するためのインタラクティブな自動ツールです。 Postmanは、HTTP APIsとやり取りするためのGoogleChromeアプリです。リクエストを作成し、レスポンスを読み取るための使いやすいGUIを提供します。バックエンドで動作し、各APIが意図したとおりに動作していることを確認します。

Postmanはより簡単にAPIを触れれるツール。

POSTMAN URL

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?