Skip to content

Commit 22e064e

Browse files
authored
Merge pull request #1 from ABXTrading/readme-updates
Update README to use syntax highlighted code sections
2 parents c0dbea1 + f2d92ff commit 22e064e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Epicurus provides a simple Request/Response and Publish/Subscribe abstraction on
77
### Instantiation
88
Instantiate Epicurus by giving it credentials to your Redis database.
99

10-
```
11-
let epicurus = Epicurus('yourRedisHost', 6379)
10+
```ts
11+
const epicurus = Epicurus('yourRedisHost', 6379)
1212
```
1313

1414
Epicurus is not a singleton. It is simply a function that instantiates an instance of the redis client, and gives the returned functions access to this instance. Each time you instantiate Epicurus, you create a new Redis client. This isn't usually a problem, but if you wish to use Epicurus through your project, it is sensible to instantiate and export the instance from one location.
@@ -18,7 +18,7 @@ The true power of Epicurus is highly performant request/response communication b
1818

1919
The request/response abstraction utilises the BRPOP mechanism of Redis to generate server listeners. These servers respond to the requesters by pushing to uniquely identified list.
2020

21-
```
21+
```ts
2222
epicurus.server('sampleEndpoint', function (request, callback) {
2323
expect(request.body).to.eql('boo')
2424
callback(null, {msg: 'hello'})
@@ -33,7 +33,7 @@ Epicurus provides a convenience wrapper around Redis PUBSUB, that allows the dec
3333

3434
This plays particularly with TypeScript enums.
3535

36-
```
36+
```ts
3737
epicurus.subscribe('sampleChannel', (msgReceived) => {
3838
expect(msgReceived).to.eql({hello: 'world', channel: 'sampleChannel'})
3939
})

0 commit comments

Comments
 (0)