Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Flex all the things #21

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ Next, lets configure the development server. To keep things simple we can put th
var hypernova = require('hypernova/server');

hypernova({
devMode: true,

getComponent(name) {
if (name === 'MyComponent.js') {
return require('./app/assets/javascripts/MyComponent.js');
Expand Down Expand Up @@ -207,8 +205,8 @@ Options, and their defaults
bodyParser: {
limit: 1024 * 1000,
},
// disables cluster mode and reloads each component every time it is requested
devMode: false,
// disables cluster mode
enableCluster: false,
// how components will be retrieved,
getComponent: undefined,
// configure the logger
Expand Down
2 changes: 0 additions & 2 deletions examples/simple/hypernova.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const hypernova = require('hypernova/server');

hypernova({
devMode: true,

getComponent(name) {
if (name === 'MyComponent.js') {
return require('./app/assets/javascripts/MyComponent.js');
Expand Down
8 changes: 4 additions & 4 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const defaultConfig = {
bodyParser: {
limit: 1024 * 1000,
},
devMode: false,
endpoint: '/batch',
enableCluster: false,
files: [],
logger: {},
plugins: [],
Expand All @@ -34,14 +34,14 @@ export default function hypernova(userConfig, onServer) {

const app = express();

if (config.devMode) {
worker(app, config, onServer);
} else {
if (config.enableCluster) {
if (cluster.isMaster) {
coordinator();
} else {
worker(app, config, onServer, cluster.worker.id);
}
} else {
worker(app, config, onServer);
}

return app;
Expand Down
2 changes: 1 addition & 1 deletion test/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ describe('Hypernova server', () => {
});

it('starts up the hypernova server without blowing up', () => {
hypernova({ devMode: true, getComponent: () => {} });
hypernova({ getComponent: () => {} });
});
});