我們ㄉ部落格(後端小作業)
-
git
- Download project
git clone https://github.com/wsa-2002/Fastapi-EntryTask-Template.git
- Create a new branch
git branch my-branch-name
- Switch to the new branch
git checkout my-branch-name
After Developing
- Add files to staging
git add .
- Commit with message
git commit -m "commit msg"
- Push to gitlab
git push --set-upstream origin my-branch-name
- Download project
-
conda env
- Create a new environment
conda create --name my-blog python=3.10
- Activate environment
conda activate my-blog
- Install dependencies
pip install -r requirements.txt
- Create a new environment
-
Postman
- Install postman
-
fastapi framework
- Run app
uvicorn app:app --reload
- Call API on postman
localhost:8000/hello-world
- Call API with parameters
localhost:8000/hello-people?name=pdogs
- Run app
-
BREAD api
- Browse: return list of objects
- Read: return single object
- Edit: edit single object
- Add: create new object
- Delete: delete single object
-
SQL
- Browse posts
- Read single post
- Add post
- Edit posts
- Delete posts
- Comment on posts
python>=3.8
fastapi
postgresql
- Design your database schema
- Design your API spec
- Init your backend project
- Implement features
- A GitLab project with a runnable schema + runnable backend code
- A
README.md
document describing how to set up + start your backend service