simov / express-admin

MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
MIT License
1.17k stars 222 forks source link

Accept PORT from environment variable. #150

Closed vgsantoniazzi closed 1 year ago

vgsantoniazzi commented 5 years ago

Currently, Heroku needs the port been set by environment variable.

There's any other option to express-admin work with $PORT from heroku?

vgsantoniazzi commented 4 years ago

@simov should we merge this?

simov commented 1 year ago

Hi @vgsantoniazzi, configuring a port is no longer applicable in v2 of the admin. In v2 the admin is simply an Express.js middleware that you can mount in your server app:

var express = require('express')
var admin = require('express-admin')

express()
  .use(admin({
    config: require('config.json'),
    settings: require('settings.json'),
    users: require('users.json'),
    custom: require('custom.json'),
  }))
  .listen(3000)

Also, the MySQL driver is no longer bundled with the admin in case you are using that. Have a look at the updated readme and also at the changelog for any potential breaking changes.