DEV Community

Robert Lawson Vaughn
Robert Lawson Vaughn

Posted on

Perl Mojolicious Hypnotoad Change Port

Hello. I am new to Mojolicious. I am trying to change the port in the full app mode. W\Web server is Hypnotoad. In the examples I see reference to a configuration (i.e. myWebSite.conf) yet when I use

mojo generate app myWebSite
Enter fullscreen mode Exit fullscreen mode

then it produces a YML file (i.e. myWebSite.yml). When I try to update the yml config file with example code from conf files I get errors.
I have tried:

---

  secrets:
- 9b2a56894703626d68a8d6bc347c4efcxxxd17fx

app->config(hypnotoad => {listen => ['http://*:8083']});
Enter fullscreen mode Exit fullscreen mode

Does not work.

I have tried:

```{
secrets => ['9b2a56894703626d68a8d6bc347c4efcxxxd17fx'],
hypnotoad => {
listen => ['http://127.0.0.1:8083'],
workers => 10
}
}



Does not work.
The script file is:


```#!/usr/bin/env perl

use strict;
use warnings;

use Mojo::File qw(curfile);
use lib curfile->dirname->sibling('lib')->to_string;
use Mojolicious::Commands;

# Start command line interface for application
Mojolicious::Commands->start_app('myWebSite');
Enter fullscreen mode Exit fullscreen mode

The error is:

alpha@localhost:~/myWebSite/script$ hypnotoad myWebSite
Can't load application from file "/home/alpha/myWebSite/script/myWebSite": Can't load configuration from file "/home/alpha/myWebSite/myWebSite.yml": CPAN::Meta::YAML failed to classify line 'app->config(hypnotoad => {listen => ['http://*:8083']});' at /usr/local/share/perl/5.34.0/Mojolicious/Plugin/NotYAMLConfig.pm line 19.
Compilation failed in require at (eval 102) line 1.
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
kraih profile image
Sebastian Riedel

The config file has to be valid YAML.