Set up sample app
We provide a sample app, MovieInfo, and a sandbox to get you going with API Studio. This includes:
- Code for one service, movieinfo, to run in your IDE
- Live services for other services the movieinfo service depends on running in the Mesh Dynamics cloud
- Mocks for the above services
Sample App: MovieInfo
When you download and install API Studio, we create the trial app, MovieInfo, in your account. We will use the example requests and mocks included with this app to get familiar with the capabilities of the tool.
Download movieinfo Service Code
We provide example code for a Java service that you can download for a quick start using the tool. The test service works with the mocks provided for the test app. To download and setup the movieinfo service code, follow the steps below.
- Clone the sample app MovieInfo repository from the following link:
- Checkout the customer_release branch:
git clone --single-branch --branch customer_release https://github.com/cube-io-corp/sample_apps.git
- Import sample_apps as a Maven project in your favorite IDE. This should import multiple modules in your workspace. MIRest is the module of interest, and it depends on Utils module. Do an mvn clean install of the Utils module.
- Next, do an mvn clean install of the MIRest project. This should create a MIRest-V1-SNAPSHOT.war in the target folder.
- You should have tomcat server as part of the IDE. Start the tomcat server running the MIRest project.
- In Eclipse IDE, right-click on the MIRest project and Run on Server. This should allow you to configure the Tomcat server and the application should start running.
- If you are using Intellij Idea, click on MIRest project and select Run > Run … from the menu. This will bring up the “Run configuration” screen. Create a new run configuration for “Tomcat Server”. In the deployment tab, check that the MIRest:war is listed and change the Application context from “/MIRest_war” to /MIRest”. The server url will show up on the server tab as “http://localhost:8080/MIRest".
Next, set up the request routing configurations in the API Studio for the sample service.