{"id":48776,"library":"node-rest-server","title":"node-rest-server","description":"A configuration-only REST server built on Express, enabling zero-code API creation via JSON/YAML/JS configuration files. Version 5.0.0 is the latest stable, with frequent releases. Differentiators include declarative route definitions, built-in request validation, and auto-generated Swagger docs. Supports TypeScript out of the box with full type declarations.","status":"active","version":"5.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/nishant-labs/node-rest-server","tags":["javascript","node rest","rest-server","express rest wrapper","configuration only rest server","typescript"],"install":[{"cmd":"npm install node-rest-server","lang":"bash","label":"npm"},{"cmd":"yarn add node-rest-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-rest-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core HTTP server framework","package":"express","optional":false},{"reason":"request body parsing","package":"body-parser","optional":false},{"reason":"cross-origin resource sharing","package":"cors","optional":true}],"imports":[{"note":"ESM-only since v5; use dynamic import in CommonJS.","wrong":"const createServer = require('node-rest-server')","symbol":"createServer","correct":"import { createServer } from 'node-rest-server'"},{"note":"TypeScript type import for config objects.","symbol":"RestServerConfig","correct":"import type { RestServerConfig } from 'node-rest-server'"},{"note":"RouteDefinition is a type only, not a runtime value.","wrong":"import { RouteDefinition } from 'node-rest-server'","symbol":"RouteDefinition","correct":"import type { RouteDefinition } from 'node-rest-server'"}],"quickstart":{"code":"import { createServer } from 'node-rest-server';\n\nconst config = {\n  port: 3000,\n  routes: [\n    {\n      method: 'GET',\n      path: '/api/users',\n      response: [\n        { id: 1, name: 'Alice' },\n        { id: 2, name: 'Bob' }\n      ]\n    }\n  ]\n};\n\ncreateServer(config).then(server => {\n  console.log(`Server running on port ${server.address().port}`);\n});","lang":"typescript","description":"Creates a REST server with one GET route returning a hardcoded array of users."},"warnings":[{"fix":"Use import syntax (ESM) or dynamic import(): const { createServer } = await import('node-rest-server').","message":"ESM-only from version 5.0.0: require() no longer works in CommonJS.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Ensure config object contains only documented keys (port, routes, etc.).","message":"Configuration validation is strict: unknown keys in config object will throw an error at startup.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Rename your config file to rest.config.json or rest.config.js and adjust imports.","message":"The legacy config file 'rest.json' is deprecated in favor of 'rest.config.js' or 'rest.config.json'.","severity":"deprecated","affected_versions":">=4.5.0"},{"fix":"Set wrapResponse: false in route config for raw response.","message":"Route responses are always wrapped in a JSON object under a 'data' key unless you set 'wrapResponse: false'.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'5.0.0':25 'api':18 'auto':45 'auto-gener':44 'box':54 'built':11,39 'built-in':38 'code':17 'configur':7,22,68 'configuration-on':6 'creation':19 'declar':35,58 'definit':37 'differenti':33 'doc':48 'enabl':14 'express':13,65 'file':23 'frequent':31 'full':56 'generat':46 'includ':34 'javascript':59 'json/yaml/js':21 'latest':28 'node':2,60 'node-rest-serv':1 'releas':32 'request':41 'rest':3,9,61,63,66,70 'rest-serv':62 'rout':36 'server':4,10,64,71 'stabl':29 'support':49 'swagger':47 'type':57 'typescript':50,72 'valid':42 'version':24 'via':20 'wrapper':67 'zero':16 'zero-cod':15","created_at":"2026-06-07T16:58:24.369228+00:00","updated_at":"2026-06-07T16:58:24.369228+00:00","problems":[{"fix":"Run 'npm install node-rest-server' and ensure your project is configured for ESM (e.g., 'type': 'module' in package.json).","cause":"Package not installed or ESM import used in CommonJS without proper flags.","error":"Error: Cannot find module 'node-rest-server'"},{"fix":"Use named import: import { createServer } from 'node-rest-server'. Do not use default import.","cause":"Default import used instead of named import.","error":"TypeError: createServer is not a function"},{"fix":"Remove 'ssl' key; node-rest-server does not support HTTPS natively. Use a reverse proxy instead.","cause":"Configuration object contains an unsupported key.","error":"ValidationError: unknown key 'ssl' in config"}],"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/nishant-labs/node-rest-server#readme","github":"ssh://git@github.com/nishant-labs/node-rest-server","docs":null,"changelog":null,"pypi":null,"npm":"node-rest-server","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}}