
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
apimd lets you to write APIs in Markdown and use them as mocks.
## GET /api/site
```yaml
branding:
label: "My Site"
url: "/mysite.svg"
navigation:
label: "My Site"
items:
- label: "Home"
url: "/"
- label: "Accounts"
url: "/accounts"
- label: "About"
url: "/about"
```
A GET
request to /api/site
will return the following json:
{
"branding": {
"label": "My Site",
"imageURL": "/mysite.svg"
},
"navigation": {
"label": "My Site",
"items": [
{
"label": "Home",
"url": "/"
},
{
"label": "Accounts",
"url": "/accounts"
},
{
"label": "About",
"url": "/about"
}
]
}
}
APIs written in Markdown can specify multiple endpoints in the same file:
## GET /api/one
```yaml
payload: "one"
```
## GET /api/two
```yaml
payload: "two"
```
APIs written in Markdown can also qualify endpoints with requests.
## POST /api/login
### Request
```yaml
username: "test"
password: "test"
```
### Response
```yaml
givenName: "Test"
sessionId: 1138
```
A POST
request to /api/login
will return a 401
with the following json:
{}
However, a POST
request with a body of {"username":"test","password":"test"}
will return a 200
with the following json:
{
"givenName": "Test",
"sessionId": 1138
}
APIs written in Markdown can qualify requests by headers as well.
## POST /api/isLoggedIn
### Request Headers
```yaml
x-session-id: "1138"
```
### Response
```yaml
success: true
```
A POST
request with a x-session-id
header of 1138
will return a 200
with the following json:
{
"success": true
}
npm install apimd
const parse = require('apimd/parse')
parse(MARKDOWN_STRING)
// server.js
const express = require('express')
const apimd = require('apimd/middleware')
app.use(apimd(/* options */))
// .rescriptsrc.js
module.exports = [
['apimd/rescript']
]
// config-overrides.js
const apimd = require('apimd/rewired')
module.exports = apimd(module.exports, /* options */)
The following fields may be configured:
{
"fallbackBody": {},
"fallbackHeaders": {},
"fallbackStatus": 401,
"jsonReplacer": null,
"jsonSpace": " ",
"live": false,
"src": "api.md"
}
Note: In the rescript and rewired versions, src
is src/api.md
.
The rescript and rewired versions of apimd may be configured from package.json
:
{
"apimd": {
"live": true
}
}
0.2.1 (November 15, 2019)
util.js
in publishFAQs
Write APIs in Markdown and use them as mocks.
The npm package apimd receives a total of 1 weekly downloads. As such, apimd popularity was classified as not popular.
We found that apimd 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.