Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: model -> models #68

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/01-get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ These are the most important directories:

- `config`: These are the configuration files for your Serverpod. These include a `password.yaml` file with your passwords and configurations for running your server in development, staging, and production. By default, everything is correctly configured to run your server locally.
- `lib/src/endpoints`: This is where you place your server's endpoints. When you add methods to an endpoint, Serverpod will generate the corresponding methods in your client.
- `lib/src/model`: The model definition files are placed here. The files define the classes you can pass through your API and how they relate to your database. Serverpod generates serializable objects from the model definitions.
- `lib/src/models`: The model definition files are placed here. The files define the classes you can pass through your API and how they relate to your database. Serverpod generates serializable objects from the model definitions.

Both the `endpoints` and `model` directories contain sample files that give a quick idea of how they work. So this a great place to start learning.
Both the `endpoints` and `models` directories contain sample files that give a quick idea of how they work. So this a great place to start learning.

### Generating code
Whenever you change your code in either the `endpoints` or `model` directory, you will need to regenerate the classes managed by Serverpod. Do this by running `serverpod generate`.
Whenever you change your code in either the `endpoints` or `models` directory, you will need to regenerate the classes managed by Serverpod. Do this by running `serverpod generate`.

```bash
$ cd mypod/mypod_server
Expand Down Expand Up @@ -115,7 +115,7 @@ To learn more about endpoints, see the [Working with endpoints](concepts/working
### Serializing data
Serverpod makes it easy to generate serializable classes that can be passed between server and client or used to communicate with the database.

The structure for your serialized classes is defined in yaml-files in the `lib/src/model` directory. Run `serverpod generate` in the home directory of the server to build the Dart code for the classes and make them accessible to both the server and client.
The structure for your serialized classes is defined in yaml-files in the `lib/src/models` directory. Run `serverpod generate` in the home directory of the server to build the Dart code for the classes and make them accessible to both the server and client.

Here is a simple example of a yaml-file defining a serializable class:

Expand Down
2 changes: 1 addition & 1 deletion docs/03-tutorials/01-first-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Make sure you have Docker running on your machine before executing these command

Serverpod comes with a convenient way to create serializable objects with the help of code generation. These objects can easily be sent back and forth between the server and the client. This is managed by defining our objects in a YAML file which the code generator then parses and generates the necessary code for.

To define the structure of our Note object, we will create a YAML file called `note.yaml` inside the `lib/src/model` directory in your Serverpod project (`notes_server`). Add the following content in `note.yaml`:
To define the structure of our Note object, we will create a YAML file called `note.yaml` inside the `lib/src/models` directory in your Serverpod project (`notes_server`). Add the following content in `note.yaml`:

```yaml
### Holds a note with a text written by the user.
Expand Down
Loading