New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jota-one/drosse

Package Overview
Dependencies
Maintainers
2
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jota-one/drosse - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

app/io.js

35

app/index.js
const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const { setScope, checkRootFile, getScope, routes } = require('./io')
const { parse } = require('./parser')
const app = express()
const port = process.env.PORT || '8000'

@@ -11,10 +13,25 @@

// define routes
app.get('*', (req, res) => {
res.send({ drosse: 8000 });
})
// start server
module.exports = args => {
console.log(args)
const port = args.port || process.env.PORT || '8000'
setScope('root', path.resolve(args.root) || path.resolve('.'))
if (args.routesFile) {
setScope('routesFile', args.routesFile)
}
// start server
app.listen(port, () => {
console.log(`Listening to requests on http://localhost:${port}`);
})
// run some checks
if (!checkRootFile()) {
console.error(`Please create a "${getScope('routesFile')}.json" or a "${getScope('routesFile')}.js" file in this directory: ${getScope('root')}, and restart.`)
process.exit()
}
// if everything is well configured, create the routes
const routesDefinition = routes()
parse(app, routesDefinition)
app.listen(port, () => {
console.log(`Listening to requests on http://localhost:${port}`)
console.log(`The mocks will be read/written here: ${getScope('root')}`)
})
}
{
"name": "@jota-one/drosse",
"version": "0.1.0",
"version": "0.1.1",
"description": "Mock your backend the right way.",
"main": "index.js",
"scripts": {
"serve": "node app"
"serve": "node bin/drosse"
},

@@ -22,3 +22,4 @@ "repository": {

"body-parser": "^1.19.0",
"express": "^4.17.1"
"express": "^4.17.1",
"yargs": "^15.3.1"
},

@@ -25,0 +26,0 @@ "devDependencies": {

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