Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

basic-node-server

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-node-server - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

mime.json

16

index.js

@@ -7,19 +7,13 @@ const http = require('http');

const csvFilePath = path.join(__dirname, '/application.csv');
const mimeJson = path.join(__dirname, '/mime.json');
const getContentType = (() => {
return new Promise((resolve, reject) => {
fs.readFile(csvFilePath, 'utf8', (err, csvData) => {
fs.readFile(mimeJson, 'utf8', (err, data) => {
if (err) {
reject(err);
} else {
const contentTypeMap = csvData.split('\n')
.map(row => row.split(','))
.reduce((map, [extension, contentType]) => {
map[extension] = contentType;
return map;
}, {});
resolve(contentTypeMap);
}
else {
resolve(data);
}
});

@@ -26,0 +20,0 @@ })

{
"name": "basic-node-server",
"version": "1.0.1",
"version": "1.0.2",
"description": "Simple node server for everyone.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,1 +18,15 @@ # basic-node-server

```
## NPM
This package is also available on NPM. To install it, run:
```
npm install basic-node-server
```
Then, to run it, run from your project directory:
```
node node_modules/basic-node-server/index.js [port]
```
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