Skip to content

2rueSid/dovzhenko

 
 

Repository files navigation

Dovzhenko

How to use

Create server

const server = new Server();

server.createServer();

server.listen(PORT)

Create route

...
const { app } = server;

app.append(<url>, async (req, res) => {...});
...

dynamic route

...
const { app } = server;
app.append('/route/:slug', async (req, res) => {...});
...

Subscribe to the channel

...
channel = new Channel(options);

app.append('route', async (req, res) => {
  ...
  await channel.subscribe(req, res, events?: Array<string>);
  ...
});
...

Publish message to the channel

...
app.append('post/route', async (req, res) => {
  ...
  await channel.publish(message, event)
  ...
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.0%
  • HTML 7.4%
  • JavaScript 1.6%
  • Other 1.0%