
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
rest-but-less
Advanced tools
rest-but-less is a lightweight and easy-to-use Node.js module designed to simplify the creation of RESTful APIs. With rest-but-less, you can quickly define endpoints for various HTTP request methods such as GET
, POST
, PATCH
, PUT
, DELETE
, OPTIONS
, and HEAD
. It automatically handles injecting dependencies from POST data, URL parameters, or a service list, making API development a breeze. Easily switch between NodeJS & AWS Lambda!
npm i rest-but-less
get
, post
, patch
, put
, Delete
, options
, and head
.Import the rest-but-less module into your Node.js application:
import { useNode, get, post, patch, Delete, put, head, options, ResponseResult } from 'rest-but-less'
Define your endpoints using the provided functions:
// Define a GET endpoint
get('/users/:id', (id:number, db:unknown): Promise<ResponseResult> => {
// Retrieve user data from the database using the provided id
});
// Define a POST endpoint
// userData is equivalent to POST.userData (or $_POST['userData'] for you PHP fans)
post('/users', (userData:Record<string,any>, db:unknown): Promise<ResponseResult> => {
// Create a new user in the database using the provided userData
});
Inject dependencies into your endpoints using the service list:
import { addService } from 'rest-but-less';
// Add a service to the service list (e.g., a MySQL database connection)
addService('db', dbInstance);
// Access the service within endpoint functions
get('/users', (db) => {
// Access the database connection (db) to retrieve user data
});
Starting a server is fairly easy.
import { useLambda } from 'rest-but-less'
export const handler = async (event, context) => {
// load in routes prior....
return await useLambda(event)
};
import { useNode } from 'rest-but-less'
useNode({
httpPort: 8080
})
import { useNode } from 'rest-but-less'
useNode({
httpPort: 8080,
httpsPort: 443,
httpsCertPath: 'path/to/cert.pem',
httpsKeyPath: 'path/to/key.pem'
})
rest-but-less is licensed under the MIT License. Feel free to use, modify, and distribute it as needed.
FAQs
Rest API, less code
We found that rest-but-less 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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.