Socket
Socket
Sign inDemoInstall

serve

Package Overview
Dependencies
Maintainers
4
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve - npm Package Compare versions

Comparing version 7.1.0 to 7.1.1

2

package.json
{
"name": "serve",
"version": "7.1.0",
"version": "7.1.1",
"description": "Static file serving and directory listing",

@@ -5,0 +5,0 @@ "scripts": {

@@ -42,4 +42,21 @@ # serve

The core of `serve` is [serve-handler](https://github.com/zeit/serve-handler), which can be used as middleware in existing HTTP servers.
The core of `serve` is [serve-handler](https://github.com/zeit/serve-handler), which can be used as middleware in existing HTTP servers:
```js
const handler = require('serve-handler');
const http = require('http');
const server = http.createServer((request, response) => {
// You pass two more arguments for config and middleware
// More details here: https://github.com/zeit/serve-handler#options
return handler(request, response);
})
server.listen(3000, () => {
console.log('Listening on http://localhost:3000');
});
```
**NOTE:** You can also replace `http.createServer` with [micro](https://github.com/zeit/micro), if you want.
## Contributing

@@ -46,0 +63,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc