This repository has been archived by the owner on May 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wraps db calls in feathers services
- Loading branch information
Showing
10 changed files
with
82 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import '@feathersjs/transport-commons'; | ||
import { Application } from '../definitions'; | ||
import '@feathersjs/transport-commons' | ||
import { Application, ServiceAddresses } from '../../definitions' | ||
|
||
export default function (app: Application) { | ||
if (typeof app.channel !== 'function') { | ||
// If no real-time functionality has been configured just return | ||
return; | ||
} | ||
app.on('connection', (connection: any) => { | ||
app.channel('offers').join(connection) | ||
app.channel('domains').join(connection) | ||
app.channel('sold').join(connection) | ||
}) | ||
app.service('/rns/v0/offers').publish(() => app.channel(`offers`)); | ||
app.service('/rns/v0/:ownerAddress/sold').publish(() => app.channel(`sold`)); | ||
app.service('/rns/v0/:ownerAddress/domains').publish(() => app.channel(`domains`)); | ||
}; | ||
if (typeof app.channel !== 'function') { | ||
// If no real-time functionality has been configured just return | ||
return | ||
} | ||
app.on('connection', (connection: any) => { | ||
app.channel('offers').join(connection) | ||
app.channel('domains').join(connection) | ||
app.channel('sold').join(connection) | ||
}) | ||
app.service(ServiceAddresses.RNS_OFFERS).publish(() => app.channel('offers')) | ||
app.service(ServiceAddresses.RNS_DOMAINS).publish(() => app.channel('domains')) | ||
app.service(ServiceAddresses.RNS_SOLD).publish(() => app.channel('sold')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.