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 fine using the Catalyst CLI.
To serve the Catalyst project locally, execute the following command from your project directory:
This Alien City application is now served at default port 3000. The local endpoint URLs of the components are displayed.
You can now open the client component’s local URL in a browser to access the Alien City application.
Let’s test the application by entering a city’s name and checking for the history of an alien encounter in the city. Since we have not reported an alien encounter in a city yet, the result should be negative.
Enter a city name in the text box and click Check.
Since a matching record for this city is not found in the Data Store, the client displays a negative response.
Now, let’s report an alien encounter. Click the Report Alien Encounter tab. Enter a city name and click Report. We have entered “Amsterdam” in our application.
The application will display a pop-up box confirming that the data is added to the Data Store.
You can verify this by opening your Catalyst console and navigating to Data Store under Storage > CloudScale. Click the Data View tab to view the record that was just inserted.
Next, let’s search for this city in the client and check if it fetches this record from the Data Store. Click Check My City in the client application and enter the name of the city that you just reported. Here, we enter “Amsterdam”. Click Check.
The client displays a positive response.
You can also check if the client displays the duplication message by reporting the same city again.
If this setup is working correctly, we can deploy the application to production.
Last Updated 2024-06-12 17:41:34 +0530 +0530