
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
fetch-rest-connect
Advanced tools
[](https://travis-ci.org/drublic/fetch-rest-connect) [](ht
Call any REST-API in the browser.
You can install this package via NPM
npm install --save fetch-rest-connect
Using yarn
yarn add fetch-rest-connect
All methods used provided by the package are asynchronous.
import Fetcher from 'fetch-rest-connect'
const CONTENT_ENDPOINT = 'content'
const fetcher = new Fetcher({
apiUrl: `/api`,
endpoints: {
[CONTENT_ENDPOINT]: '/content/',
},
options: { // optional
credentials: 'include',
}
})
const getContent = async () => {
try {
const data = await fetcher.getAll(CONTENT_ENDPOINT)
return data
} catch (error) {
throw new Error(error)
}
}
Your API endpoints can also hold any kind of variable:
const endpoints = {
[CONTENT_ENDPOINT]: '/article/:articleId/content/'
}
When calling the fetcher you can now pass uriParams
to fill the vars in the
route.
const articleId = `foo`;
const uriParams = {
articleId,
};
const data = await fetcher.getAll(CONTENT_ENDPOINT, uriParams)
All methods build upon the main method fetch
:
fetch
, Fetch entry point
action: string
, Action or endpoint you want to call, requiredid: String
, If you want to call a specific ID of an endpoint, you can use this fielduriParams: Object
, If the endpoint has variables in it you can use this object to fill themadditionalQueryParams: object
, Pass get parameters for the requestdata: Object
, Data you want to send with the requestmethod: ENUM('GET' | 'PUT' | 'POST' | 'DELETE') = 'GET'
, Specific method you want for your callheaders: Object
, additional headers for requestParams are the same as above
get(action, id, uriParams, additionalQueryParams, headers)
getAll(action, uriParams, additionalQueryParams, headers)
create(action, data, uriParams, additionalQueryParams, headers)
update(action, id, data, uriParams, additionalQueryParams, headers)
upsert(action, id, data, uriParams, additionalQueryParams, headers)
delete(action, id, uriParams, additionalQueryParams, headers)
This library is licensed under MIT
FAQs
[](https://travis-ci.org/drublic/fetch-rest-connect) [](ht
The npm package fetch-rest-connect receives a total of 3 weekly downloads. As such, fetch-rest-connect popularity was classified as not popular.
We found that fetch-rest-connect 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.