Skip to content

Commit

Permalink
Added support for linked data types
Browse files Browse the repository at this point in the history
n-triples, json-ld and plain old csv (=old data-nerds fav.)
  • Loading branch information
Sanne Peters committed Mar 6, 2018
1 parent dc5e62b commit 51ff65d
Show file tree
Hide file tree
Showing 7 changed files with 1,265 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ The matching works on the filename by treating it as `PATH.VERB.CONTENT_TYPE` so
`json`. Supported content types are

```
json => application/json
html => text/html
txt => text/plain
js => application/javascript
json => application/json
html => text/html
txt => text/plain
js => application/javascript
csv => text/csv
// linked-data formats:
nt => application/n-triples
jsonld => application/ld+json
```

So an example is for querying (with canned running on localhost:3000)
Expand Down
5 changes: 4 additions & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ Response.content_types = {
'json': 'application/json',
'html': 'text/html',
'txt': 'text/plain',
'js': 'application/javascript'
'js': 'application/javascript',
'nt': 'application/n-triples',
'csv': 'text/csv',
'jsonld': 'application/ld+json'
}

Response.cors_headers = [
Expand Down
Loading

0 comments on commit 51ff65d

Please sign in to comment.