Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
localbased
Advanced tools
Localbased is an intuitive no-code tool designed to assist developers, particularly frontend engineers, in quickly setting up a REST API for communicating with databases on their local machines. It aims to simplify the process of creating a backend server
Localbased is an intuitive no-code tool designed to assist developers, particularly frontend engineers, in quickly setting up a REST API for communicating with databases on their local machines. It aims to simplify the process of creating a backend server and accessing dynamic data, enabling frontend developers to create full-stack side projects without the need to worry about building a REST API or handling database interactions.
npm i -g localbased
In your current working directory run
localbased start --port [port]
this command starts the server on the specified port else the server runs on a default port of 2048
.
E.g
localbased start --port 4000
this command starts the server on the specified port 4000
localbased start
this command starts the server on the default port 2048
Description: Creates a record in the database.
Endpoint: /:collectionName/create
Method: POST
Request Body:
{
...data
}
Sample Request: POST /users/create
{
"name": "owoade anuoluwapo",
"email": "owoade@once.com",
"password": "manager"
}
Sample Response
{
"status": "success",
"response": {
"collectionName": "users",
"data": {
"_id": "51130271-1839-492b-b50b-1cca2ff19aa2",
"name": "owoade anuoluwapo",
"email": "owoade@once.com",
"password": "manager",
"timestamps": {
"createdAt": "2024-01-15T00:22:49.430Z",
"updatedAt": "2024-01-15T00:22:49.430Z"
}
}
}
}
/:collectionName/get/all
Parameter | Type | Description |
---|---|---|
page | number | This enables pagination of data, facilitating the retrieval of specific subsets for more efficient handling of large datasets. The default value is 1. |
limit | number | This refers to the amount of to be returned per request. The default value is 50. |
order | string | This is the order in which the result will be returned and can either be of value a which denotes ascending order or d descending order. The default value is a |
Sample Request: GET /users/get/all?order=a&limit=3&page=1
Sample Response
{
"status": "success",
"response": {
"collectionName": "users",
"count": 359,
"data": [
{
"_id": "cb405221-2266-4d87-9939-ded1fbd3eab7",
"username": "Mary",
"password": "kemi",
"timestamps": {
"createdAt": 1705267312054
}
},
{
"_id": "a4bd932a-1f8e-4ff8-84c5-95e800326e1c",
"username": "Mary",
"password": "kemi",
"timestamps": {
"createdAt": 1705267325168
}
}
]
}
}
/:collectionName/get/single/:id
Parameter | Type | Description |
---|---|---|
id | string | This is the of the record to be fetched. |
Sample Request: GET /user/get/single/cc6443a8-7633-45d4-b6a1-4335c3c59f81
Sample Response
{
"status": "success",
"response": {
"collectionName": "users",
"data": {
"_id": "cc6443a8-7633-45d4-b6a1-4335c3c59f81",
"name": "owoade anuoluwapo",
"password": "manager",
"timestamps": {
"createdAt": "2024-01-14T22:55:53.010Z",
"updatedAt": "2024-01-14T23:16:22.222Z"
},
"is_admin": true
}
}
}
Description: Updates a record in the database.
Endpoint: /:collectionName/update/:id
Method: PATCH
Request Body:
{
"update": {
...updates
}
}
Sample Request: PATCH /user/update/cc6443a8-7633-45d4-b6a1-4335c3c59f81
{
"update": {
"is_admin": true
}
}
Sample Response
{
"status": "success",
"response": {
"collectionName": "users",
"data": {
"_id": "cc6443a8-7633-45d4-b6a1-4335c3c59f81",
"name": "owoade anuoluwapo",
"password": "manager",
"timestamps": {
"createdAt": "2024-01-14T22:55:53.010Z",
"updatedAt": "2024-01-14T23:16:22.222Z"
},
"is_admin": true
}
}
}
Description: Deletes a record from the database.
Endpoint: /:collectionName/delete/:id
Method: DELETE
Sample Request: DELETE /user/delete/cc6443a8-7633-45d4-b6a1-4335c3c59f81
{
"update": {
"is_admin": true
}
}
Sample Response
{
"status": "success",
"response": {}
}
An error response can be returned for a number of reasons, below is an example of an error response that can be returned. Note that all error response structure are the same.
{
"status": "error",
"response": false,
"reason": "Document not found"
}
...Start Building 🚀🚀
Created with 🧡 by Owoade
FAQs
Localbased is an intuitive no-code tool designed to assist developers, particularly frontend engineers, in quickly setting up a REST API for communicating with databases on their local machines. It aims to simplify the process of creating a backend server
We found that localbased demonstrated a healthy version release cadence and project activity because the last version was released less than 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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.