Test the Application

Before you deploy the application to the remote console, you can test the application on a local server and check if everything works using the Catalyst CLI. For detailed information on catalyst serve, refer to the Serve Resources help page.

To serve the Catalyst project locally, execute the following command from your project directory:

copy
$
catalyst serve

The to-do list application will now be served at default port 3000. The local endpoint URLs of the components are displayed.

catalyst_todo_basic_serve
catalyst_todo_angular_serve
catalyst_todo_react_serve
Note: Every time you access the home page or any of the sub-pages of your client, or the function, the CLI will display a live log of the URL accessed, along with the HTTP method that is used to access it.

You can now open the client component’s local URL in a browser to access the application.

catalyst_todo_serve_1

Let’s test the application by adding a task to the to-do list. Enter a task and click Create Task.

catalyst_todo_serve_2

The task will be added and displayed in the app.

catalyst_todo_serve_3


Let’s verify this. Open the TodoItems table in the Data Store from your Catalyst console.

Click the Data View tab to view the record. A row will be created for the list item that was added.

catalyst_datastore_dataview


Let’s add a few more tasks to the to-do list app. We can now test the delete operation.

catalyst_todo_serve_4

When you hover on a task, the delete-bin icon appears in the top-right corner. The delete operation is executed when you click the icon. The task will be removed from the list. The app displays the updated list.

catalyst_todo_serve_5


Let’s verify if the record was deleted in the Data Store. Open the TodoItems table in the Data Store and click Data View to view the records. The row for the list of items will be deleted from the table.

catalyst_datastore_dataview_deleted

If this setup is working correctly, we can deploy the application to production.


Last Updated 2024-06-12 17:41:34 +0530 +0530