{"id":46952,"library":"apis","title":"Apis","description":"Apis is a JavaScript library for building RESTful APIs with WebSocket support. Version 0.1.2 provides a modular architecture built around 'units' and a loader system that automatically assembles application parts. It features flexible settings, advanced routing with contracts and resources, support for multiple servers (HTTP/HTTPS, IPv4/IPv6), cluster and domain support, daemonization, logging, and multiple transports including WebSocket, JSONP, and batch requests. Key differentiators include CORS-enabled by default (with CSRF protection), a range of built-in handlers (authentication, data validation, static files), and client libraries for Node.js and browsers. It is designed for creating web and WebSocket APIs with a RESTful philosophy emphasizing stateless operations and cacheable GET requests.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/velocityzen/apis","tags":["javascript","api","rest","web","websocket"],"install":[{"cmd":"npm install apis","lang":"bash","label":"npm"},{"cmd":"yarn add apis","lang":"bash","label":"yarn"},{"cmd":"pnpm add apis","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import is the main entry point.","wrong":"const apis = require('apis')","symbol":"apis","correct":"import apis from 'apis'"},{"note":"Named export for creating servers.","wrong":null,"symbol":"createServer","correct":"import { createServer } from 'apis'"},{"note":"Class for defining API resources.","wrong":null,"symbol":"Resource","correct":"import { Resource } from 'apis'"}],"quickstart":{"code":"import apis from 'apis';\nimport { createServer, Resource } from 'apis';\nconst server = createServer({\n  port: 3000,\n  contract: [\n    Resource.create('/hello', {\n      get(ctx) {\n        ctx.json({ message: 'Hello World' });\n      }\n    })\n  ]\n});\nserver.start().then(() => console.log('Server running on port 3000'));","lang":"javascript","description":"Shows how to import apis, create a server, define a simple GET resource, and start the server."},"warnings":[{"fix":"Enable CSRF protection using built-in mechanisms or disable CORS/JSONP where appropriate.","message":"All resources are CORS-enabled and JSONP-available by default; ensure CSRF protection for authenticated requests.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set 'options' handler to null in resource definition to disable.","message":"Every resource has an 'options' handler by default that exposes resource description; override with null if not desired.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.1.2':15 'advanc':36 'api':1,2,10,101,114 'applic':30 'architectur':19 'around':21 'assembl':29 'authent':81 'automat':28 'batch':61 'browser':92 'build':8 'built':20,78 'built-in':77 'cacheabl':110 'client':87 'cluster':48 'contract':39 'cor':67 'cors-en':66 'creat':97 'csrf':72 'daemon':52 'data':82 'default':70 'design':95 'differenti':64 'domain':50 'emphas':106 'enabl':68 'featur':33 'file':85 'flexibl':34 'get':111 'handler':80 'http/https':46 'includ':57,65 'ipv4/ipv6':47 'javascript':5,113 'jsonp':59 'key':63 'librari':6,88 'loader':25 'log':53 'modular':18 'multipl':44,55 'node.js':90 'oper':108 'part':31 'philosophi':105 'protect':73 'provid':16 'rang':75 'request':62,112 'resourc':41 'rest':9,104,115 'rout':37 'server':45 'set':35 'stateless':107 'static':84 'support':13,42,51 'system':26 'transport':56 'unit':22 'valid':83 'version':14 'web':98,116 'websocket':12,58,100,117","created_at":"2026-06-07T16:49:00.009018+00:00","updated_at":"2026-06-07T16:49:00.009018+00:00","problems":[{"fix":"Run 'npm install apis' to install the package.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'apis'"},{"fix":"Use named import: import { createServer } from 'apis'","cause":"Wrong import style; default import does not have createServer directly.","error":"TypeError: apis.createServer is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/velocityzen/apis#readme","github":"https://github.com/velocityzen/apis","docs":null,"changelog":null,"pypi":null,"npm":"apis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}