mirror of
https://github.com/kou029w/hasura-rest-hands-on.git
synced 2025-02-22 16:45:54 +00:00
fix
This commit is contained in:
parent
dccfabafe6
commit
76f4d84d8a
3 changed files with 17 additions and 7 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
- [Hasura Cloud](https://cloud.hasura.io/) - すぐに利用可能なHasuraの環境
|
||||
- [Heroku Postgres](https://jp.heroku.com/postgres) - すぐに利用可能なデータベース
|
||||
- [CodeSandbox](https://codesandbox.io/) - フロントエンドのオンライン開発環境
|
||||
- [CodeSandbox](https://codesandbox.io/) (あるいは、[StackBlitz](https://stackblitz.com/)) - フロントエンドのオンライン開発環境
|
||||
- [Vue 3](https://vuejs.org/) - プログレッシブWebフレームワーク
|
||||
- [Quill](https://quilljs.com/) - リッチテキストエディター
|
||||
|
||||
|
|
|
@ -1,18 +1,28 @@
|
|||
# Vueアプリケーションの作成
|
||||
|
||||
[](https://stackblitz.com/github/kou029w/hasura-rest-hands-on/tree/main/frontend?terminal=dev&file=src/App.vue)
|
||||
[](https://codesandbox.io/s/github/kou029w/hasura-rest-hands-on/tree/main/frontend?file=/src/App.vue)
|
||||
[](https://stackblitz.com/github/kou029w/hasura-rest-hands-on/tree/main/frontend?terminal=dev&file=src/App.vue)
|
||||
|
||||
いずれかのリンクにアクセスし、Vueアプリケーションを作成します。
|
||||
|
||||
なお、URLに含まれる `memo-demo` は、Hasura Cloudプロジェクト名によって異なるので、適宜自分の作成したプロジェクトに合わせて読み替えてください。
|
||||
|
||||
```vue
|
||||
<!-- src/App.vue -->
|
||||
{{#include ../frontend/src/App.vue}}
|
||||
```
|
||||
|
||||
ローカル環境で作成する場合は、CodeSandboxにアクセスし、左の[Files]パネルから[↓ (Export to Zip)]ボタンを押すと、ソースコード一式をダウンロードできます。ダウンロードしたZIPファイルを展開後、`npm install` コマンドなどで必要なパッケージを導入することで同様にVueアプリケーションを作成できます。
|
||||
|
||||
ソースコードの中には、HasuraのREST APIのエンドポイントURLが含まれます。そのURLに含まれるドメイン名の部分の `memo-demo` は、Hasura Cloudプロジェクト名です。プロジェクトによって異なるので、自分の作成したプロジェクトに合わせて書き換えましょう。
|
||||
|
||||
```js
|
||||
// src/App.vue
|
||||
{{#include ../frontend/src/App.vue:8:9}}
|
||||
```
|
||||
|
||||
このエンドポイントURLを自分の作成したプロジェクトのものに書き換えると完成です。
|
||||
|
||||
Hasuraを使用してPostgresデータベースに接続したREST APIを構築し、それを利用したWebアプリを作成できました 🎉
|
||||
|
||||
Hasuraのコンソールにアクセスすると、実際にデータが更新されていることを確認できます。
|
||||
|
||||

|
||||
|
||||
Hasuraを使用してPostgresデータベースに接続したREST APIを構築し、それを利用したWebアプリを作成できました🎉
|
||||
|
|
|
@ -5,7 +5,7 @@ import "@vueup/vue-quill/dist/vue-quill.snow.css";
|
|||
import axios from "axios";
|
||||
import debounce from "lodash.debounce";
|
||||
|
||||
/* ここに作成したREST APIエンドポイントを指定します。 `memo-demo` の部分はHasura Cloudプロジェクト名です。 */
|
||||
// ここに作成したREST APIエンドポイントを指定します。 `memo-demo` の部分はHasura Cloudプロジェクト名です
|
||||
const endpoint = "https://memo-demo.hasura.app/api/rest/page/1";
|
||||
|
||||
export default {
|
||||
|
|
Loading…
Add table
Reference in a new issue