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

There is no way to set dev server bind address (hostname) #3776

Closed
pahaz opened this issue Sep 24, 2020 · 5 comments
Closed

There is no way to set dev server bind address (hostname) #3776

pahaz opened this issue Sep 24, 2020 · 5 comments

Comments

@pahaz
Copy link
Contributor

pahaz commented Sep 24, 2020

Bug report

At the moment you can only set --port.

@pahaz pahaz changed the title There is no way to set dev server bind address There is no way to set dev server bind address (hostname) Sep 24, 2020
@bookyo
Copy link

bookyo commented Sep 26, 2020

hi bro, you can use custom server.
server.js

const express = require('express');
const { keystone, apps } = require('./index.js');

keystone
  .prepare({
    apps: apps,
    dev: process.env.NODE_ENV !== 'production',
  })
  .then(async ({ middlewares }) => {
    await keystone.connect();
    const app = express();
    app.set('trust proxy', true);
    app.use(middlewares).listen(3000);
  });

and change 3000 to your want. start server.js use node server.js

@pahaz
Copy link
Contributor Author

pahaz commented Oct 1, 2020

Yes, I know. I already use it. I think it should be a part of the default CLI.

@gautamsi
Copy link
Member

if you use PORT env in .env and load using NODE_OPTIONS like this

"dev": "cross-env NODE_ENV=development NODE_OPTIONS=\"-r esm -r dotenv/config\" DISABLE_LOGGING=true keystone dev",

I have used esm for es6 style importing.

@stale
Copy link

stale bot commented Mar 19, 2021

It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)

@stale stale bot added the needs-review label Mar 19, 2021
@bladey
Copy link
Contributor

bladey commented Apr 8, 2021

Keystone 5 has officially moved into active maintenance mode as we push towards the next major new version Keystone Next, you can find out more information about this transition here.

In an effort to sustain the project going forward, we're cleaning up and closing old issues such as this one. If you feel this issue is still relevant for Keystone Next, please let us know.

@bladey bladey closed this as completed Apr 8, 2021
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