Skip to content

Commit

Permalink
Comments a bit and update generator version
Browse files Browse the repository at this point in the history
  • Loading branch information
Raathigesh committed Jun 25, 2016
1 parent 489b8f2 commit 4a3b60c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atmo",
"version": "0.9.5",
"version": "0.9.6",
"description": "Server side powertool for prototyping",
"main": "src/server/index.js",
"scripts": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"homepage": "https://github.com/Raathigesh/Atmo",
"dependencies": {
"apollo-server": "^0.1.2",
"atmo-gen-expressjs-es5": "0.0.4",
"atmo-gen-expressjs-es5": "0.0.5",
"chalk": "^1.1.3",
"express": "^4.13.4",
"express-http-proxy": "^0.7.1",
Expand Down
18 changes: 17 additions & 1 deletion src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ var npmi = require('npmi');

app.use(express.static(__dirname + '../../../dist'));

/**
* Port of the dashboard server
*/
var port = 3333;

/**
* Start the dashboard server
*/
server.listen(port, function () {
console.log(chalk.blue('Atmo dashboard v' + pack.version + ' is available at: http://localhost:' + port));
});

/**
* API server
*/
var apiServerPort = argv.port || 3334;
var api = apiServer.createApiServer(apiServerPort, argv.static, argv.logs);

Expand Down Expand Up @@ -55,7 +65,7 @@ io.on('connection', function (socket) {
socket.on('generate', function (payload) {
var renerator = require(payload.generator);
renerator(payload.spec);
socket.emit('message', 'Your generated project is available in ' + path.join(process.cwd(), 'build'))
socket.emit('message', 'Your generated project is available in ' + path.join(process.cwd(), 'project'))
});

socket.on('installGenerator', function (name) {
Expand All @@ -67,13 +77,19 @@ io.on('connection', function (socket) {
});
});

/**
* Add a generator name to the generator meta data file
*/
function addGenarator(name) {
var generatorsData = jsonfile.readFileSync(generatorsDataFile);
generatorsData.generators.push(name);
jsonfile.writeFileSync(generatorsDataFile, generatorsData);
return generatorsData;
}

/**
* Install the generator npm package programmatically
*/
function installGenerator(name, socket) {
var options = {
name: name,
Expand Down

0 comments on commit 4a3b60c

Please sign in to comment.