Skip to content

lanytcc/http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An HTTP module designed for lanyt.js

Introduction

This module is imported through a dynamic link library from lanyt.js, providing simple yet comprehensive HTTP send and receive functions.

Installation

git clone https://github.com/lanytcc/quickjs.git
git clone https://github.com/lanytcc/http.git
cd http
zig build

How to use

import * as http from "libhttp.so"; // if you use windows, you need use ".dll"

const server = new http.server();

server.listen("0.0.0.0", 8080);
server.on("/", (req) => {
    var r = req.get();
    console.log(r.method);
    return new http.response({
        status: 200,
        body: "Hello, world!"
    });
});
server.dispatch();

About

An HTTP module designed for lanyt.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages