Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonycorletti committed Jul 28, 2023
1 parent 682b23b commit 3bf9ab1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 9 additions & 7 deletions docs/getting-started/apps.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Packages
# Apps

Snok is great for scaffolding out initial, un-opinionated structure for your python package.
Snok is great for scaffolding out RESTful APIs with FastAPI.

## Getting ready

Expand Down Expand Up @@ -98,7 +98,7 @@ snok server
And in another terminal session run:

```sh
$ curl -s -X GET http://127.0.0.1:8000/livez
curl -s -X GET http://127.0.0.1:8000/livez
```

You should see something to the effect of:
Expand Down Expand Up @@ -143,7 +143,7 @@ PGPASSWORD=myapp psql -h 0.0.0.0 -U myapp -c "create database myapp_development
And run the migrations:

```sh
alembic revision --autogenerate -m "persons"
alembic revision --autogenerate -m "posts"
alembic upgrade head
```

Expand All @@ -167,7 +167,9 @@ Indexes:

Wow! That's cool! Let's commit our code to git again and move on to the next part.

### Create a FastAPI APIRouters
If you run into any pre-commit snags, you can run `snok format` to format your code. Snok uses `ruff` under the hood to format your code, so you can run `ruff` directly if you want to as well.

### Create FastAPI APIRouters

Creating routers is fairly straightforward.

Expand All @@ -181,7 +183,7 @@ Now run the server again and check out the new endpoint:
snok server
```

If you go to http://127.0.0.1:8000/docs in your browser you should see the new endpoints!
If you go to [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) in your browser you should see the new endpoints!

Fill those in however you like.

Expand Down Expand Up @@ -221,7 +223,7 @@ Let's test this code out!
snok test
```

Awesome! We just generated a whole CRUD feature with tests super fast!
Awesome! We just generated a fully tested CRUD feature with tests super fast!

Let's run our migrations.

Expand Down
4 changes: 4 additions & 0 deletions docs/getting-started/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ snok new mypackage
```sh
snok ok
```

Now you're ready to start building your package!

<br />
7 changes: 4 additions & 3 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ edit_uri: ""
nav:
- Welcome: index.md
- Getting Started:
- Getting Started: getting-started/hello-snok.md
- Snok Packages: getting-started/packages.md
- Snok Apps: getting-started/apps.md
- 🐍 Getting Started: getting-started/hello-snok.md
- 📦 Snok Packages: getting-started/packages.md
- 🌎 Snok Apps: getting-started/apps.md
- 🚀 Modal: getting-started/modal.md
- Development & Contributing: contributing.md
- Release Notes: release-notes.md

Expand Down

0 comments on commit 3bf9ab1

Please sign in to comment.