Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Add REST API code from the chill-dashboard #1

Merged
merged 16 commits into from
Jun 23, 2017
Merged

Add REST API code from the chill-dashboard #1

merged 16 commits into from
Jun 23, 2017

Conversation

badyakarprabin
Copy link
Contributor

@badyakarprabin badyakarprabin commented Jun 17, 2017

Extract the REST API express server code from chill-dashboard to this repository.

Note: Some of the files here (eg: config.js, logger.js etc) are complete copy-paste from those from the chill repository, we'll need to extract these common codes, utils, and initialization/config stuff to a new package called chill-core to avoid code duplication.

.eslintrc Outdated
@@ -0,0 +1,30 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy the .eslintrc.yml file from the chill repo instead. https://github.com/leapfrogtechnology/chill/blob/master/.eslintrc.yml

@badyakarprabin
Copy link
Contributor Author

  • Copied code from chill repo and pasted in chill rest api repo .

.nodemonignore Outdated
test

# Other directories
src/server/seeds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/server?

.postcssrc.js Outdated
@@ -0,0 +1,8 @@
// https://github.com/michael-ciniawsky/postcss-load-config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a frontend specific file. Not needed here

.travis.yml Outdated
@@ -0,0 +1,10 @@
language: node_js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which editor are you using? It's putting unnecessary characters at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS code

package.json Outdated
},
"keywords": [
"chill",
"dashboard"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest-api

package.json Outdated
"babel-preset-es2015": "^6.18.0",
"babel-preset-es2016": "^6.16.0",
"babel-preset-es2017": "^6.16.0",
"babel-preset-react": "^6.23.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

package.json Outdated
"babel-loader": "^6.2.10",
"babel-plugin-istanbul": "^4.1.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.0",
"babel-plugin-transform-react-remove-prop-types": "^0.3.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need

package.json Outdated
"mocha": "^3.2.0",
"node-sass": "^4.5.0",
"nodemon": "^1.11.0",
"postcss-loader": "^1.3.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

package.json Outdated
"nodemon": "^1.11.0",
"postcss-loader": "^1.3.3",
"rimraf": "^2.5.4",
"sass-loader": "^6.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

package.json Outdated
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"supertest": "^2.0.1",
"url-loader": "^0.5.8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

* @return {Promise}
*/
export async function getStatus(id) {
return await new Status({ id }).fetch()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let status = await new Status({ id }).fetch();

if (!status) {
  throw new Boom.notFound('Service not found');
}

return status;

})
]
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badyakarprabin I think you've made some changes in this log format in the chill right? Copy that from here https://github.com/leapfrogtechnology/chill.

@kabirbaidhya kabirbaidhya changed the title Dev Rest API codes Add REST API code from the chill-dashboard Jun 17, 2017
.babelrc Outdated
"es2015", "es2016", "es2017"
],
"comments": false,
"env": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need this block

.eslintrc Outdated
@@ -0,0 +1,30 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file. We already have .eslintrc.yml file now.

@kabirbaidhya
Copy link
Contributor

I'll finalize this PR.

@kabirbaidhya kabirbaidhya dismissed their stale review June 19, 2017 17:53

Rest of the people will review this

@kabirbaidhya kabirbaidhya removed the wip label Jun 19, 2017
@mesaugat
Copy link
Member

The question is how many repositories will me make?

@kabirbaidhya
Copy link
Contributor

Nice question 😄.

@mesaugat
Copy link
Member

And why do we need those configuration files here?

@kabirbaidhya
Copy link
Contributor

kabirbaidhya commented Jun 20, 2017

They aren't actually separate config files, both the rest api and monitor needs to access the same chill.yml file. That's the issue.
Even if we have config.yml for just monitor and .env file for the rest-api (as was before) we're going to have some config keys duplicated in both of the places and utils like logger are common for both. That's why we'll need to make the chill.yml file a centralized config file.

Also, as we're thinking of moving the persistence logic from chill to the rest-api, it needs to access the services array of the chill.yml too.

@romitamgai romitamgai merged commit af008a6 into master Jun 23, 2017
@mesaugat mesaugat deleted the dev branch June 23, 2017 10:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants