def react_ecosystem( name, port ):
    """ returns the pm2 ecosystem configuration string for react apps """
    return """
module.exports = {
  apps : [{
    name: '%s',
    script: 'npx',
    interpreter: 'none',
    args: 'serve build -s -l %s',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'development'
    },
    env_production: {
      NODE_ENV: 'production'
    }
  }]
};
""" % (name, port)