or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
用Strapi 10分鐘就建好API(Strapi介紹-前篇)
來源: https://strapi.io/documentation/3.0.0-beta.x/getting-started/quick-start.html
前篇(快速入門)
中篇(概念架構介紹)
後篇(部署及設定)
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Step 1. 在電腦上安裝Strapi
Step 2. 使用指令快速新建你的Strapi專案
(此快速建置的流程中,預設的資料庫為SQLite,可以在指令中另外選擇)
路徑: **/my-project
成功後自動開啟註冊頁面
註冊一個最高層級使用者的帳號(此為開發模式,可以放心測試,帳號隨便註冊都可以)
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →註冊完成後就會看到admin儀表板頁面
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Step 3. 建立和更新資料結構 Create a new Content Type
資料結構是擁有多個欄位以及資料的集合,接下來先新增Restaurant的資料結構試試看!
建立Restaurant的資料結構:
點擊右上的新增欄位
首先設定餐廳的名稱
接著設定餐廳的描述
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →點擊右上角的儲存
建立Category的資料結構(返回建立和更新資料結構主頁面):
點擊右上的新增欄位
首先設定Category的名稱
接著設定Category的關聯
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →點擊右上角的儲存
Step 4. 為各個資料結構增添一點內容吧!
1. Restaurants: 點擊左上角的Restaurants
你沒看錯也沒有打錯字,Strapi會自動將資料結構名稱變為複數的單字
Strapi Restaurant
Strapi restaurant is a cosy restaurant delivering one of the very fastest and nicest dining experiences in the world, combining nods to tradition with fierce modernity, warmth with daring.
2. Categories: 點擊左上角的Categories
點擊右上角的建立新的Category
Convenient
再新增一筆!
Time Saving
將新增完的Categories,給Restaurant使用吧!
Step 5. 設定 角色與權限
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →備註: Strapi預設為關閉公開API的權限
Step 6. 開心使用API~
專案的網址為
http://localhost:1337/
接著你可以在網址後面加上像是
/restaurants
來使用restaurants的API- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →需在專案目錄下輸入以下指令來完成安裝graphQL
使用以下網址即可使用graphQL
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →