
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Effortlessly transform your PostgreSQL database into a powerful REST and GraphQL API server with zero coding required
install pg-apify:
bun install pg-apify
// or
npm install pg-apify
local installation of postgREST is also required, follow official wiki to install correctly.
creates and use .env file or passes the configuration directly via parameters and run server
import { pgApifyServer, postgraphileOptions, postgrestOptions } from "pg-apify";
import { dev as options } from "./postgraphileOptions";
const postgraphileServerOptions: postgraphileOptions = {
enabled: true,
databaseUrl: process.env.DATABASE_URL,
schema: process.env.PGSCHEMA,
options: options,
};
const postgrestServerOptions: postgrestOptions = {
enabled: true,
enableDocs: true,
};
pgApifyServer(postgraphileServerOptions, postgrestServerOptions);
a GraphQL server, RestAPI and OpenAPI documentation will be launched
🚀 GraphQL server available at http://localhost:5000/graphql
🚀 GraphiQL available at http://localhost:5000/graphiql
📖 API docs is running at http://localhost:3000/docs
🔥 API is running at http://localhost:3000
The postgraphileOptions file contains the Postgraphile options (docs), see the example file, copy it or create your own custom configuration file.
intercepts all GET requests
requestHandler.registerHandler("get", async (params, context, info) => {
// your code
return {
success: false,
status: 404,
message: "Custom error message",
};
});
or specific endpoint
requestHandler.registerRouteHandler(
"get",
"foo",
async (params, context, info) => {
// your code
return {
success: false,
status: 404,
message: "Custom error message",
};
}
);
pg-apify leverages PostGraphile, a powerful tool that automatically generates a GraphQL API from your PostgreSQL schema. PostGraphile inspects your database schema, including tables, columns, relationships, and constraints, and creates a fully-functional GraphQL API. This allows you to take advantage of GraphQL's flexibility and efficiency in querying and mutating data.
In addition to GraphQL, pg-apify also utilizes PostgREST, a standalone web server that turns your PostgreSQL database directly into a RESTful API. PostgREST reads the database schema and creates RESTful endpoints that correspond to your tables and views, enabling CRUD operations with ease.
Using scalar to generate interactive API documentation from OpenAPI/Swagger documents.
FAQs
<img alt="NPM Down
We found that pg-apify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.