Last change
on this file since 2624 was 2624, checked in by Bruno Cornec, 4 years ago |
More tests around OpenAPI - back to a working server with v3
|
File size:
487 bytes
|
Rev | Line | |
---|
[2624] | 1 | package ProjectBuilder::Controller::Example;
|
---|
| 2 | use Mojo::Base 'Mojolicious::Controller';
|
---|
| 3 |
|
---|
| 4 | # This action will render a template
|
---|
| 5 | sub welcome {
|
---|
| 6 | my $self = shift;
|
---|
| 7 |
|
---|
| 8 | # Render template "example/welcome.html.ep" with message
|
---|
| 9 | $self->render(msg => 'Welcome to the Project-Builder real-time web framework based on Mojolicious!');
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | sub hello_world {
|
---|
| 13 | my $c = shift->openapi->valid_input or return;
|
---|
| 14 |
|
---|
| 15 | my $output = { greeting => 'Hello World' };
|
---|
| 16 | $c->render(openapi => $output);
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.