LoginSignup
0
0

More than 1 year has passed since last update.

【備忘録】WebAPIサーバを作るとはどういうことか

Posted at

RailsとReactでSPA化を実装したいのですが、そもそもWebAPIサーバの意味が理解できていなかったため、記事に残しました。

SPAでは、最初のページにあたるHTMLのみをサーバから取得し、その後の画面の書き換え等をすべてクライアント側(ブラウザ内)のJavaScriptで実施する。
そのため、SPAのアプリケーションでは、サーバ側(Rails側)のアプリケーションの役割はいわゆるWebAPIとしてブラウザ側のJavaScriptとAjax通信を行うのみ、というケースも多い。

API専用Railsアプリケーションの生成コマンド

$ rails new my_api --api

▼詳細はRailsガイドを参照

▼参考記事

大変わかりやすかったです!

0
0
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
0
0