
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
lightly-node-server
Advanced tools
A lightweight and easily Node.js module for creating a simple HTTP server. If you're working on a larger project, consider using Express
My English is not well so if you didn't understand, I'm sorry
A lightweight Node.js module for creating a simple HTTP server. If you're working on a larger project, consider using Express
var {Server} = require( "light-node-server" )
new Server().listen(8080, () => console.log( "127.0.0.1:8080" ))
index.html
<h1>lightly-node-server</h1>
visit 127.0.0.1:8080 you will see lightly-node-server
Class server
-- constructor( path, cb )
---- path : Your pages's root dir. Default is "."
---- cb( pathname, res, req ) : Callback function when server be visit
------ pathname : user visit's path
-- listen( port, cb )
---- as http.createServer(...).listen
-- tags
---- tags.set( tag, cb )
------ tag : tagname
------ cb( path, res, req ) : A callback function when a page has this tag and be request
-------- path : user visit's file's path
---- tags.get( tag )
------ tag : tagname
Custom a tag for your special pages and nice function
set a custom tag
var server = new Server()
server.tags.set( "mytag", (fn) => "u are visiting " + fn )
server.listen(8080)
visit http://127.0.0.1:8080/mytag:index.html
u will see u are visiting index.html
node Tag
I made a node tag for run a js file as nodejs runtime code and use npm module in front-end
Run test.js and visit http://127.0.0.1:7074/node:log.js
You will see the hello on your terminal and var log = {hello : () => console.log( "hello" )} on your browser
light-node-server/tspage/log.js
console.log( "hello" )
module.exports = {
hello : () => console.log( "hello" )
}
if u want use an npm-module u can also node:xxx needn't node:node_modules/xxx/index.js
FAQs
A lightweight and easily Node.js module for creating a simple HTTP server. If you're working on a larger project, consider using Express
We found that lightly-node-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.