[dancer-users] Mig Dancer 1 to 2: set confdir does not work?
Jochen Schnuerle
js at betabox.de
Tue May 24 10:03:07 BST 2016
Hello,
I have created a webportal for my server installation and configuration
functions with Dancer1. Now I want to add ldap user support and I think
this is the opportunity to migrate to Dancer2.
First I created a webapp with
dancer2 gen -a "fsi" -p /opt/test/
After that I move the environment and config yml files to the etc dir
and delete the environments dir. I want a clean root dir and so I move
the rest of the files to the new doc dir.
[root at fsisrv6 fsi]# pwd
/opt/test/fsi
[root at fsisrv6 fsi]# tree
.
??? bin
? ??? app.psgi
??? doc
? ??? cpanfile
? ??? Makefile.PL
? ??? MANIFEST
? ??? MANIFEST.SKIP
??? etc
? ??? config.yml
? ??? development.yml
? ??? production.yml
??? lib
? ??? fsi.pm
??? public
? ??? 404.html
? ??? 500.html
? ??? css
? ? ??? error.css
? ? ??? style.css
? ??? dispatch.cgi
? ??? dispatch.fcgi
? ??? favicon.ico
? ??? images
? ? ??? perldancer-bg.jpg
? ? ??? perldancer.jpg
? ??? javascripts
? ??? jquery.js
??? t
? ??? 001_base.t
? ??? 002_index_route.t
??? views
??? index.tt
??? layouts
??? main.tt
From my Dancer1 project, I copy the three set lines to the fsi.pm file:
- - --- -- --- -- - ----
package fsi;
use Dancer2;
set confdir => "/opt/test/fsi/etc";
set envdir => "/opt/test/fsi/etc";
set environment => 'development';
our $VERSION = '0.1';
get '/' => sub {
template 'index';
};
true;
- - --- -- --- -- - ----
If I now start the portal with
plackup -s Starman --workers=10 -a /opt/test/fsi/bin/app.psgi -p 3000
I see in the "Your application's environment" section:
Location: /opt/test/fsi
Template engine: <% settings.template %>
Logger: <% settings.logger %>
Environment: <% settings.environment %>
So I think Dancer2 cannot find the config.yml file. I read that I must
create a .dancer file in the etc dir:
[root at fsisrv6 etc]# ls -lisa
insgesamt 20
5376363 4 drwxr-xr-x 2 root root 4096 19. Mai 07:52 .
5376297 4 drwxr-xr-x 9 root root 4096 19. Mai 07:51 ..
5376359 4 -rw-r--r-- 1 root root 1414 19. Mai 07:52 config.yml
5376327 0 -rw-r--r-- 1 root root 0 19. Mai 07:49 .dancer
5376361 4 -rw-r--r-- 1 root root 727 19. Mai 07:49 development.yml
5376352 4 -rw-r--r-- 1 root root 302 19. Mai 07:49 production.yml
But that does not work. What am I doing wrong? Who can help, please?
Thank you & Regards
Jochen
PS:
env infos:
- CentOS 6 and 7
- Dancer2 0.166001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160524/aadab38a/attachment.html>
More information about the dancer-users
mailing list