1.0.6 • Published 2 years ago

server-fast v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Explain

  • "server" is a package used to create servers fast.

How To Use

  • It's very easy to use.

  • First, lets get the package.

import { Server } from '@hyperflame1/server';
  • Second, we must create a new instance of it.
let server = new Server();
  • And finally, we run the server.
let port = 8080;
let res = server.open('http', port);
  • Then, go to "http://localhost:8080/" and thats what the page looks like.

  • It's a bit empty at the moment, you can draw text or an element on a screen.

server.send(res, 'Hello, World!');
  • And then, that text will show on the screen.

  • You can also draw HTML elements on there.

server.send(res, '<div id="element"></div>');
  • This is also usable with TypeScript, of course.
npm i node
npm i @hyperflame1/server
const { Server } = require('@hyperflame1/server');

let port = 8080;

type num = number | Number;

function open(p: num): void {
  server.open('http', p);
}

open(port);

Web Socket

  • WebSocket support will be added later.
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

5 years ago