Skip to content

Commit

Permalink
update create app template deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jul 21, 2020
1 parent 8e7547d commit 397ff97
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
12 changes: 6 additions & 6 deletions packages/xarc-create-app/template/_package.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ module.exports = (base, merge) => {
npm: ">= 6"
},
dependencies: {
"@xarc/app": "^8.1.6",
"@xarc/fastify-server": "^1.1.0",
"@xarc/app": "^8.1.7",
"@xarc/fastify-server": "^2.0.0",
react: "^16.13.1",
"react-dom": "^16.13.1",
redux: "^4.0.5",
"react-redux": "^7.2.0",
"subapp-react": "^0.0.21",
"subapp-redux": "^1.0.30",
"subapp-server": "^1.2.4",
react: "^16.13.1",
redux: "^4.0.5"
"subapp-server": "^1.2.4"
},
devDependencies: {
"@xarc/app-dev": "^8.1.6"
"@xarc/app-dev": "^8.1.7"
}
};

Expand Down
39 changes: 39 additions & 0 deletions packages/xarc-create-app/template/src/server/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";

/**
* A simple configuration to setup fastify to serve routes for the
* Electrode X webapp.
*
* To support config composition base on environment, checkout these:
*
* 1. https://www.npmjs.com/package/electrode-confippet
* 2. https://www.npmjs.com/package/config
*
*/
exports.config = {
connection: {
host: process.env.HOST || "localhost",
// Allow Electrode X to control app's listening port during dev
// to serve both static assets and app under a unified proxy port
port: parseInt(process.env.APP_SERVER_PORT || process.env.PORT || "3000")
},
plugins: {
/**
* Register the dev support plugin
*/
"@xarc/app-dev": {
priority: -1,
enable: process.env.WEBPACK_DEV === "true"
},
/**
* Register the server routes plugin for the app
*/
"subapp-server": {
options: {
cdn: {
enable: process.env.NODE_ENV === "production"
}
}
}
}
};
21 changes: 1 addition & 20 deletions packages/xarc-create-app/template/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,7 @@

const support = require("@xarc/app/support");
const electrodeServer = require("@xarc/fastify-server");

const config = {
connection: {
host: process.env.HOST || "localhost",
port: parseInt(process.env.APP_SERVER_PORT || process.env.PORT || "3000")
},
plugins: {
"@xarc/app-dev": {
priority: -1,
enable: process.env.WEBPACK_DEV === "true"
},
"subapp-server": {
options: {
cdn: {
enable: process.env.NODE_ENV === "production"
}
}
}
}
};
const { config } = require("./config");

async function start() {
await support.load();
Expand Down

0 comments on commit 397ff97

Please sign in to comment.