
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
All apis resources are by default fully CORS and JSONP available. You must use CSRF protection for all your authenticated requests (even for GET requests) and apis supports such protection by default too. Optionally, you can check Origin of your requests or disable CORS/JSONP functionality (completely or for choosen request handlers).
By default, apis philosophy is to allow cross-origin requests and be ready for them.
Also, by default, every resource will have 'options' handler providing resource description and it will not be protected by authentication or something. You can allways override this handler with null or your own variant.
Handler interface:
setup(chain)
- can be used to perform some interaction between handlers of chain, used by Impl
and Ret
handle(ctx)
- async handle, must not throw any exceptions, use ctx.error()
instead, usually must call ctx.next()
at some pointTo get test page on /test_page
add to your contract:
cont('/test', [apis.testPage.contract])
For any app, if it cannot be found, apis default will be used.
core.app - known by app actually (which also is loader), the app itself
core.uncaught - uncaught exception handler
core.logging - logging subsystem
core.mechanics.web - web mechanics, enables responding on HTTP requests
core.mechanics.socket - socket mechanics, enables web socket communications, runs on top of web mechanics
core.settings - settings, will be searched at cwd()+'/lib/settings'
core.handler - main app contract, will be searched at cwd()+'/lib/contract'
For both core.settings and core.handler units, if unit cannot be found, apis default will be used.
MIT
FAQs
Library for creation web and websocket restful APIs
The npm package apis receives a total of 112 weekly downloads. As such, apis popularity was classified as not popular.
We found that apis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.