Skip to content

Commit

Permalink
New release
Browse files Browse the repository at this point in the history
  • Loading branch information
jijeshmohan committed Nov 9, 2015
1 parent c548748 commit cbbfade
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.3.0 / Nov 9 - 2015
=======================
* Serve static files
* JWT support


1.2.0 / Jun 21 - 2015
=======================
* Delay Responses
Expand Down
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can download the latest binary distribution from [here](https://github.com/j

[Go](https://golang.org/dl/) should be installed (version **1.4+** is required) in the system. Make sure you have Go properly installed, including setting up your [GOPATH](http://golang.org/doc/code.html#GOPATH).

```go get github.com/jijeshmohan/janus```
```go get -u github.com/jijeshmohan/janus```

### How to run

Expand All @@ -41,7 +41,7 @@ The basic structure of config file shown below. A config file has follwing attri
* jwt
* resources
* urls

* static

Detailed description of each attributes are below.

Expand Down Expand Up @@ -125,6 +125,18 @@ You need to specify username and password like below
}
```

##### Static

**staic** in configuration allows to serve static files in janus. With this option you can make janus to serve static files for your api ( e.g. javascript frontend like angular, reactjs etc..)

```js
"static": {
"url": "/ui",
"path": "public"
}
```
In above configuration, url specifies what would be the root path of your static files , like `http://localhost:8080/ui/index.html` and `path` specified the actual directory from which teh static files need to be served. This is relative to the configuration files directory.


##### REST enspoints

Expand Down Expand Up @@ -187,7 +199,7 @@ Note: Url also support dynamic url like ```/admin/{user}/enable``` which can mat

### TODO

* File upload/download support
* File upload support
* Compression
* Websocket support.
* Admin UI for configuration and adding url at runtime.
Expand Down
76 changes: 76 additions & 0 deletions example/config_jwt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"port": 8000,
"enableLog": false,
"delay": 0,
"jwt": {
"url": "/auth/token",
"exp": 12,
"secret": "WOW,MuchShibe,ToDogge",
"data": {
"userid": 1234,
"admin": false
}
},
"static": {
"path": "dist",
"url": "/"
}
"resources": [
{
"name": "user",
"headers": {
"X-Auth-Token": "sample_token"
}
}
],
"urls": [
{
"url": "/admin/{user}/disable",
"status": 200,
"method": "POST",
"file": "other/disable.json",
"headers": {
"New-Header": "header value",
"Admin": "true"
}
},
{
"url": "/admin/{user}/enable",
"status": 500,
"method": "POST"
},
{
"url": "/admin/disabled",
"status": 200,
"method": "GET",
"file": "other/disable.json"
},
{
"url": "/auths/current-user",
"status": 200,
"content_type": "application/json",
"method": "GET",
"file": "other/users.json"
},
{
"url": "/users/auth/google_oauth2",
"status": 200,
"content_type": "application/json",
"method": "POST",
"file": "other/users.json"
},
{
"url": "/stage",
"status": 200,
"content_type": "application/json",
"method": "GET",
"file": "other/stages.json"
},
{
"url": "/candidates",
"status": 200,
"content_type": "application/json",
"method": "POST"
}
]
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// simple way of tracking version
const VERSION = "1.2.0"
const VERSION = "1.3.0"

0 comments on commit cbbfade

Please sign in to comment.