From 3087cac28b991459cf45b90845118a3edeac750b Mon Sep 17 00:00:00 2001 From: Ewan Date: Fri, 2 Feb 2024 07:23:37 +0000 Subject: [PATCH] fix: Fix more model -> models references. (#68) Co-authored-by: Ewan Nisbet --- docs/01-get-started.md | 8 ++++---- docs/03-tutorials/01-first-app.mdx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/01-get-started.md b/docs/01-get-started.md index e82b6b8c..3661f75a 100644 --- a/docs/01-get-started.md +++ b/docs/01-get-started.md @@ -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 @@ -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: diff --git a/docs/03-tutorials/01-first-app.mdx b/docs/03-tutorials/01-first-app.mdx index 01ed0df7..5f466c17 100644 --- a/docs/03-tutorials/01-first-app.mdx +++ b/docs/03-tutorials/01-first-app.mdx @@ -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.