Comments (12)
Can I see what your config looks like?
from lapis.
worker_processes ${{NUM_WORKERS}};
error_log stderr notice;
daemon off;
env LAPIS_ENVIRONMENT;
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen ${{PORT}};
lua_code_cache off;
location / {
default_type text/html;
set $_url "";
content_by_lua_file "web.lua";
}
location /static/ {
alias static/;
}
location /favicon.ico {
alias static/favicon.ico;
}
location = /query {
internal;
postgres_pass database;
postgres_query $echo_request_body;
}
}
upstream database {
postgres_server ${{pg POSTGRESQL_URL}};
}
}
from lapis.
I'm fairly certain you need to create a config.moon
file which contains the value for ${{pg POSTGRESQL_URL}}
. It was one of the first obstacles I ran into as well. (It's documented but for some reason I missed it.)
-- config.moon
import config from require "lapis.config"
config "development", ->
port 8080
postgresql_url "postgres://user:pass@host/dbname"
from lapis.
My config.moon looks like this:
import config from require "lapis.config"
config "development", ->
postgresql_url "postgres:://jlebrech:127.0.0.1/mydatabase"
So I'm not sure this is where the problem lies.
from lapis.
(FYI, there is a double colon in postgres:://
.)
from lapis.
The error message is unrelated to the double " but thanks for noticing
from lapis.
I think the double colon is the problem. The error message you are getting is because the compiled config has a blank string as the postgres url in the upstream block. This is because your postgres url is improperly formed and couldn't be parsed. I'll update the code to produce a better error message.
from lapis.
I fixed the string to not have a double colon, so it's not that particular
thing but maybe my string is still wrong.
On May 2, 2013 7:42 PM, "leaf" [email protected] wrote:
I think the double colon is the problem. The error message you are getting
is because the compiled config has a blank string as the postgres url in
the upstream block. This is because your postgres url is improperly formed
and couldn't be parsed. I'll update the code to produce a better error
message.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-17356344
.
from lapis.
Ah I see now, there is a typo in the docs. The correct format for the db string is:
config "development", ->
postgresql_url "postgres://pg_user:[email protected]/my_database"
from lapis.
here's my "app" https://github.com/jlebrech/mylapisapp
I still get a warning about this
directive "postgres_server" is not terminated by ";" in /Users/jlebrech/mylapisapp/nginx.conf.compiled:39
from lapis.
It looks like you didn't compile the config file from moon to lua, so configuration is not being loaded and set.
There are a few things I can do to make this better. First I can just throw an error when an variable that isn't set is being used in the config syntax. So you don't get difficult to debug errors from Nginx.
Secondly, the Lapis runtime doesn't depend on MoonScript but I can make it detect if MoonScript is installed and load the config.moon
file if the Lua equivalent isn't there. I still think it's probably best to compile it though because if you deploy just Lua files to another server it might not have MoonScript.
For now, just run moonc .
in the current directory and the server should start.
from lapis.
damn, that fixed it.
It's funny because when I delete the lua file it compiles for me, I just
assumed it was doing that.
On Sat, May 4, 2013 at 4:56 PM, leaf [email protected] wrote:
It looks like you didn't compile the config file from moon to lua, so
configuration is not being loaded and set.There are a few things I can do to make this better. First I can just
throw an error when an variable that isn't set is being used in the config
syntax. So you don't get difficult to debug errors from Nginx.Secondly, the Lapis runtime doesn't depend on MoonScript but I can make it
detect if MoonScript is installed and load the config.moon file if the
Lua equivalent isn't there. I still think it's probably best to compile it
though because if you deploy just Lua files to another server it might not
have MoonScript.For now, just run moonc . in the current directory and the server should
start.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-17436496
.
from lapis.
Related Issues (20)
- Warning: No Lua interpreter detected for version 5.4. Not creating ./lua.bat HOT 1
- Can I use "content" in etlua? HOT 1
- Missing deps HOT 3
- Error include module for lapis version 1.9.1 HOT 1
- Intermittent "405 Method Not Allowed" HOT 2
- version 1.11.0 route get/post bug? HOT 2
- CORS for localhost frontend? HOT 8
- Fully qualified calls to HTML generation functions HOT 3
- Postgresql how to add default value current_date HOT 1
- luarocks install lapis did not see installed openssl HOT 4
- route name cannot be one of the paths HOT 2
- Specifying backend=pgmoon now required? HOT 1
- Value not available in sub-sub-template if render(..., {value = ...}) used in the template
- Default Route - Open Redirect HOT 1
- Module Migrations not found HOT 1
- Error when trying to start server HOT 3
- display "listening on ..." on startup HOT 2
- Loading static files like css with cqueues server HOT 2
- Database type could not be determined from configuration (postgres, mysql, sqlite)
- How to get client ip? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lapis.