diff --git a/readme.md b/readme.md index 845c52d..bc32bab 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,15 @@ -about this project +About this project ================== -this project contains a set of examples and tests for the RESTful API for the -sTeam server. +This project contains a set of examples and tests for the RESTful API for the sTeam server. -the code is written in coffeescript and needs node.js only for coffeescript translation. -deployment can be done as static javascript files, and does not need any kind of dynamic server for the front-end. +The code is written in coffeescript and needs node.js only for coffeescript translation. +Deployment can be done as static javascript files, and does not need any kind of dynamic server for the front-end. -the back-end is a RESTful API written for the sTeam server as used by techgrind.asia +The back-end is a RESTful API written for the sTeam server as used by techgrind.asia -development instructions +Development instructions ======================== step 1: install node.js @@ -27,8 +26,14 @@ step 3: install node packages: npm install -this installs all dependencies (including coffee) for our project into the project's node_modules directory based on the 'package.json' file +This installs all dependencies (including coffee) for our project into the project's node_modules directory based on the 'package.json' file +Install angular.js and other angular packages. + + bower install angular + bower install angular-ui-router + bower install angular-bootstrap + bower install bootstrap step 4: start the server @@ -44,33 +49,33 @@ so we can just say coffee scripts/server.coffee -if the server is working you'll see: +If the server is working you'll see: - Listening on port 8000 + Listening on port 7000 -how to contribute your changes +How to contribute your changes ============================== -fork the project on github +Fork the project on github -clone the forked project to your computer +Clone the forked project to your computer git clone https://github.com//steam-rest -follow the instructions above to set up your environment +Follow the instructions above to set up your environment -when you are properly set up you should be able to load http://localhost:8000/ in your browser +When you are properly set up you should be able to load http://localhost:8000/ in your browser each example should be a standalone application, so copy one example, and modify it. -push changes to your repo frequently. +Push changes to your repo frequently. -when ready please file a merge request or notify the project developers about your contribution +When ready please file a merge request or notify the project developers about your contribution ======= -testing +Testing ======= [FrisbyJS](http://frisbyjs.com/) is used to test the API. It is run through [Jasmine](http://jasmine.github.io/) and is based on [nodejs](http://nodejs.org/). @@ -78,12 +83,12 @@ testing Once you have nodejs installed, run the following statement to install Frisby and Jasmine: ``` -npm install -g jasmine-node frisby +npm install jasmine-node frisby ``` Then execute the test by: ``` cd project/directory -jasmine-node tests/ +jasmine-node test/ ``` diff --git a/src/js/steam.coffee b/src/js/steam.coffee index b029eb4..805ac71 100644 --- a/src/js/steam.coffee +++ b/src/js/steam.coffee @@ -46,7 +46,7 @@ services.value 'version', '0.1' # REST api documentation) services.factory 'steam', ($http, localStorageService) -> - baseurl = 'http://dev-back1.techgrind.asia/' + baseurl = 'http://ngtg.techgrind.asia/' restapi = baseurl+'scripts/rest.pike?request=' # helperfunction to preprocess the returned data. diff --git a/test/frisby/registration_tests_spec.js b/test/frisby/registration_tests_spec.js index 540fb27..d763f86 100644 --- a/test/frisby/registration_tests_spec.js +++ b/test/frisby/registration_tests_spec.js @@ -15,7 +15,7 @@ function testRegistrationDate (rd) { // Registration Tests frisby.create('Testing Registration API calls') - .post('http://dev-back1.techgrind.asia/scripts/rest.pike?request=register', { + .post('http://ngtg.techgrind.asia/scripts/rest.pike?request=register', { email: "gcitester@tester.com", fullname: "test user tg gci", group: "techgrind", diff --git a/test/frisby/rest_spec.js b/test/frisby/rest_spec.js index eae0b59..de7ccc3 100644 --- a/test/frisby/rest_spec.js +++ b/test/frisby/rest_spec.js @@ -88,7 +88,7 @@ function toBeDateIfExists (val) { // frisby.create('Test techgrind.events to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events') .expectStatus(200) .expectJSON({ "request": "techgrind.events", @@ -104,7 +104,7 @@ frisby.create('Test techgrind.events to be well-formed') frisby.create('Test techgrind.events/order-by-date to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events/order-by-date') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events/order-by-date') .expectStatus(200) .expectJSON({ "request": "techgrind.events/order-by-date", @@ -120,7 +120,7 @@ frisby.create('Test techgrind.events/order-by-date to be well-formed') frisby.create('Testing an instance of an event to be well-formed') - .get('http://dev-back1.techgrind.asia/scripts/rest.pike?request=techgrind.events.blug-coding-for-fun') + .get('http://ngtg.techgrind.asia/scripts/rest.pike?request=techgrind.events.blug-coding-for-fun') .expectStatus(200) .expectJSON({ "request": "techgrind.events.blug-coding-for-fun",