Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port ? ecr include ? #186

Closed
tigernassau opened this issue Aug 5, 2016 · 6 comments
Closed

port ? ecr include ? #186

tigernassau opened this issue Aug 5, 2016 · 6 comments

Comments

@tigernassau
Copy link

nice framework
minor isssues and maybe crystal issues but we cant' find anywhere:

  1. how can we change to start on another port ? ie 8000 instead of 3000
  2. how can we include other ecr files ie.
    home.ecr:
    <%- include header.ecr %>
    <%- include footer.ecr %>
    this syntax gave errors
    thks
@Angarsk8
Copy link

Angarsk8 commented Aug 5, 2016

Hi @tigernassau ,

For running a Kemal project on another port different to 3000, you have three alternatives (or even more):

  1. You can compile the app by executing the command crystal build src/<name_of_your_app>.cr [options], execute the command ./<name_of_your_app> --port <port_number> and your app will run in the specified port if it is available.
  2. You can override the default port number used by Kemal. All you have to do is write Kemal.config.port = <port_number> somewhere in your app. That way you can run the app using the crystal executable like this: crystal src/<name_of_your_app>.cr, and again, your app will run in the specified port if it is available.
  3. You can change the default configuration used by Kemal to run the server in development mode. To do that you have to go to libs/kemal/kemal/config.cr and change the instance variable of the class Config at the line 19.

@sdogruyol
Copy link
Member

sdogruyol commented Aug 5, 2016

You can change environment with KEMAL_ENV. For example:

KEMAL_ENV=production crystal app.cr

@plainas
Copy link

plainas commented Mar 3, 2017

Can you guys add this to the documentation on kemal's website?

@sdogruyol
Copy link
Member

@plainas just opened an issue on kemalcr.com repo 👍

@ghost
Copy link

ghost commented Mar 18, 2017

@sdogruyol But how does the ECR include stuff works?

So include a view partial from another folder?

@sdogruyol
Copy link
Member

@oltmannsdaniel you can use render inside you ecr file.

# /views/main.ecr
<%= render "./views/partial.ecr" %>

Hello from main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants