HTTP-Related Commands

Create-Controller

Table 3. Create-Controller Flags
FlagDescriptionExample

-l, —lang

The language used for the controller

—lang groovy

-f, —force

Whether to overwrite existing files

—force

The create-controller command generates a Controller class. It follows a *Controller convention for generating the class name. It creates an associated test that will run the application and instantiate an HTTP client, which can make requests against the controller.

  1. $ mn create-controller Book
  2. | Rendered template Controller.java to destination src/main/java/example/BookController.java
  3. | Rendered template ControllerTest.java to destination src/test/java/example/BookControllerTest.java

Create-Client

Table 4. Create-Client Flags
FlagDescriptionExample

-l, —lang

The language used for the client

—lang groovy

-f, —force

Whether to overwrite existing files

—force

The create-client command generates a simple Client interface. It follows a *Client convention for generating the class name. It does not create an associated test.

  1. $ mn create-client Book
  2. | Rendered template Client.java to destination src/main/java/example/BookClient.java

Create-Websocket-Server

Table 5. Create-Websocket-Server Flags
FlagDescriptionExample

-l, —lang

The language used for the server

—lang groovy

-f, —force

Whether to overwrite existing files

—force

The create-websocket-server command generates a simple WebSocketServer class. It follows a *Server convention for generating the class name. It does not create an associated test.

  1. $ mn create-websocket-server MyChat
  2. | Rendered template WebsocketServer.java to destination src/main/java/example/MyChatServer.java

Create-Websocket-Client

Table 6. Create-Websocket-Client Flags
FlagDescriptionExample

-l, —lang

The language used for the client

—lang groovy

-f, —force

Whether to overwrite existing files

—force

The create-websocket-client command generates a simple WebSocketClient abstract class. It follows a *Client convention for generating the class name. It does not create an associated test.

  1. $ mn create-websocket-client MyChat
  2. | Rendered template WebsocketClient.java to destination src/main/java/example/MyChatClient.java