Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ara-cli",
"version": "1.0.0-alpha.3",
"version": "1.0.0-alpha.4",
"description": "Ara Framework Command Line Interface",
"keywords": [
"ara",
Expand All @@ -23,11 +23,11 @@
"dependencies": {
"aws-sdk": "^2.509.0",
"cac": "^6.5.2",
"chalk": "^2.4.2",
"chalk": "^3.0.0",
"download": "^7.1.0",
"execa": "^3.3.0",
"majo": "^0.8.0",
"ora": "^3.4.0",
"ora": "^4.0.2",
"s3rver": "^3.3.0",
"sao": "^1.6.1",
"serverless-offline": "^5.10.1",
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ cli.command('run:lambda', 'Run Hypernova lambda function')

cli.command('run:proxy', 'Run Nova Proxy')
.option('--config [config]', 'Configuration file')
.action(({ config = './nova-proxy.json' }) => runProxy(config, path.join(__dirname, '../.ara')));
.option('-p, --port [port]', 'Port running proxy', { default: 8080 })
.action(({ config = './nova-proxy.json', port }) => runProxy({
config,
port,
}, path.join(__dirname, '../.ara')));

cli.command('run:cluster', 'Run Nova Cluster')
.option('--config [config]', 'Configuration file')
Expand Down
13 changes: 8 additions & 5 deletions src/run/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ const ora = require('ora');
const chalk = require('chalk');
const execa = require('execa');

module.exports = async (config, dest) => {
const VERSION = '1.1.0';

module.exports = async ({ config, port }, dest) => {
let url;
let fileName = 'nova-proxy';
let fileName = `nova-proxy_${VERSION}`;
const platform = os.platform();
if (platform === 'darwin') {
url = 'https://github.com/ara-framework/nova-proxy/releases/download/1.0.5/nova-proxy-darwin-amd64';
url = `https://github.com/ara-framework/nova-proxy/releases/download/${VERSION}/nova-proxy-darwin-amd64`;
} else if (platform === 'win32') {
url = 'https://github.com/ara-framework/nova-proxy/releases/download/1.0.5/nova-proxy-windows-amd64.exe';
url = `https://github.com/ara-framework/nova-proxy/releases/download/${VERSION}/nova-proxy-windows-amd64.exe`;
fileName = `${fileName}.exe`;
}

Expand All @@ -38,11 +40,12 @@ module.exports = async (config, dest) => {

try {
process.env.CONFIG_FILE = process.env.CONFIG_FILE || config;
process.env.PORT = process.env.PORT || port;

if (!process.env.HYPERNOVA_BATCH) {
return console.error(chalk.red('HYPERNOVA_BATCH environment variable is required'));
}
console.log(chalk.green('Nova proxy running!!'));

const child = execa(executable);

child.stdout.pipe(process.stdout);
Expand Down