Registry / devops / just-rest

just-rest

JSON →
library0.0.20-alphajsnpmunverified

Just REST is a simple REST server framework for Node.js (version 0.0.20-alpha, requires Node >= 8.0.0). It provides a module-based routing system where URLs are mapped to HTTP method handlers using regex patterns, with support for interceptors and global middleware like body parsing. Unlike full-featured frameworks like Express, it emphasizes minimalism and direct control, but is in early alpha stage with limited documentation and community. Best suited for small projects needing a lightweight REST API.

npm install just-rest
INSTALL
IMPORT
SIG · JUST-REST
J
just-rest
devopsjavascriptv0.0.20-alpha
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Modules
const { Modules } = require('just-rest');
import { Modules } from 'just-rest';
Package uses CommonJS; ESM import not supported.
Server
const { Server } = require('just-rest');
const Server = require('just-rest').Server;
Server is exported as a named export.
Middlewares
const { Middlewares } = require('just-rest');
const Middlewares = require('just-rest/middlewares');
Middlewares is a named export, not a submodule.

Creates a simple REST server with a JSON body parser middleware and a response interceptor.

const { Modules, Server, Middlewares } = require('just-rest'); Modules.defineResponseInterceptor((req, res) => { res.setHeader('Content-Type', 'application/json'); }); Modules.defineGlobalMiddleware(Middlewares.bodyJson); Modules.define('./path/to/module.js'); new Server({ Modules, port: 3002 }); console.log('Server running on port 3002');
Debug
Known issues
gotchaModules must be defined before creating Server instance.
fix
Ensure all Modules.define() calls are made before new Server().
affects: >=0.0.0
gotchaRoute regex patterns are raw JavaScript regex strings; no automatic escaping.
fix
Quote regex special characters in paths manually, e.g., '/path-to-api/([0-9]+)'.
affects: >=0.0.0
deprecatedVersion is 0.0.20-alpha: unstable API, breaking changes likely.
fix
Pin version in package.json and prepare for updates.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'just-rest'
Package not installed or path incorrect.
fix
Run 'npm install just-rest' in project root.
TypeError: Modules.define is not a function
Import error: using default import instead of destructured named export.
fix
Use: const { Modules } = require('just-rest');
TypeError: Server is not a constructor
Import error: wrong import style or Server not resolved.
fix
Ensure Server is imported as named export: const { Server } = require('just-rest');
Upgrade
Version history
0.0.20-alphalatest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
just-rest — npm install just-rest · libregistry