This is a web server as test bed you don't need to install Apache, Express, or other web server to test your HTML/CSS web application front-end. Note:

serverette

submited by
Style Pass
2024-10-13 18:00:05

This is a web server as test bed you don't need to install Apache, Express, or other web server to test your HTML/CSS web application front-end.

Note: This server is not for production. Serverette currently support only GET, HEAD, POST, PUT, DELETE, OPTIONS, and PATCH methods. CONNECT and TRACE are not supported.

To know if your project is ES Module type look at the package.json file, it should have "type": "module", line. Your package.json should look something similar to this:

NOTE: For all callback above, you can use your custom callback function. Serverette will return an array of the streamed data as a parameter for your callback function like: yourCallbackFunction(["data stream 1","data stream 2"]) you may need your function to combine or iterate through them.

Serverette support callback function to catch the request body received and to hijack the response before sending it to browser/client. Your custom function/callback will get an array of the data stream as the first parameter and the response object as the second parameter. If you want to add custom POST behavior, you need to import callbacks object first and add your custom post function. Note that post function is in lowercase.

Leave a Comment
Related Posts