Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

santuy

Package Overview
Dependencies
Maintainers
3
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

santuy - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

2

package.json
{
"name": "santuy",
"version": "1.1.6",
"version": "1.1.7",
"description": "Santuy is a nextjs framework and SQL for auto generate data from model",

@@ -5,0 +5,0 @@ "main": "index.ts",

@@ -19,2 +19,7 @@ # Santuy

```ts
//create database santuy
CREATE DATABASE `santuy`;
```
### Model

@@ -259,2 +264,35 @@

}
```
### Get Data
```ts
//file: api/get/route.ts
//url: http://localhost:3000/api/get?model=users
//url: http://localhost:3000/api/get?model=categories
//url: http://localhost:3000/api/get?model=products
import { NextResponse } from 'next/server';
import { NextRequest } from "next/server";
import { DatabaseType, get, GetType } from 'santuy';
export async function GET(request: NextRequest) {
const database: DatabaseType = {
host: "localhost",
user: "root",
password: "",
port: 3306,
database: "santuy",
}
const model = request.nextUrl.searchParams.get("model") || "";
const getData: GetType = {
model,
database
}
const response: any = await get(getData);
if (!response) {
return NextResponse.json("No Data!", { status: 400 })
}
return NextResponse.json(response, { status: 200 })
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc