https://github.com/simpleweb/sgnmapper
sgnodemapper as a service
https://github.com/simpleweb/sgnmapper
Last synced: 12 months ago
JSON representation
sgnodemapper as a service
- Host: GitHub
- URL: https://github.com/simpleweb/sgnmapper
- Owner: simpleweb
- Created: 2012-06-07T10:56:45.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-06-07T11:14:23.000Z (about 14 years ago)
- Last Synced: 2024-04-15T14:25:23.683Z (about 2 years ago)
- Language: CoffeeScript
- Homepage: http://sgnmapper.herokuapp.com/
- Size: 97.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sgnodemapper as a service
This project provides an [sgnodemapper]() over http, allowing easy
conversion from `http` to `sgn` and back again.
## Install
Clone this repository from GitHub, then install the dependencies using
`npm(1)`.
```
git clone https://github.com/simpleweb/sgnmapper.git
cd sgnmapper
npm install
```
## Usage
### Server
To start the server on port 3000 you can run:
```
./node_modules/.bin/coffee server.coffee
```
Alternativly you can use [foreman](https://github.com/ddollar/foreman)
to manage running the application processes, this will start them on
port 5000.
```
foreman start
```
### Client
To convert an http url to an sgn url, provide the url as a parameter,
with `curl(1)` it would look something like:
```
$ curl -s http://localhost:3000/ -d 'url=http://twitter.com/hecticjeff'
{"url":"http://twitter.com/hecticjeff","sgn":"sgn://twitter.com/?ident=hecticjeff","sgnParsed":{"domain":"twitter.com","keyName":"ident","value":"hecticjeff"}}
```
To convert from sgn url back to http, provide an `sgn` parameter:
```
$ curl -s http://localhost:3000/ -d 'sgn=sgn://twitter.com/?ident=hecticjeff'
{"url":"http://twitter.com/hecticjeff","sgn":"sgn://twitter.com/?ident=hecticjeff","sgnParsed":{"domain":"twitter.com","keyName":"ident","value":"hecticjeff"}}
```
## Copyright
Copyright Chris Mytton, Simpleweb 2012