Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme.md #2

Open
wants to merge 3 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
45 changes: 25 additions & 20 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -44,46 +49,46 @@ 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/<your name>/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/).

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/
```
2 changes: 1 addition & 1 deletion src/js/steam.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/frisby/registration_tests_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]",
fullname: "test user tg gci",
group: "techgrind",
Expand Down
6 changes: 3 additions & 3 deletions test/frisby/rest_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down