
Security News
Static vs. Runtime Reachability: Insights from Latio’s On the Record Podcast
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
api-pls enables you to effortlessly create JSON API-compliant APIs.
Note: this project is a work in progress. It currently functions in a limited manner.
It can be time-consuming to put together an application with a robust backend. Use api-pls to speed up that process considerably.
Instead of writing database and API code within your project, simply define models, and let this tool do the rest.
api-pls will:
✓ Configure a database for you
✓ Set up a web server that adheres to JSON API for interactions with those resources
✓ Create and run migrations for you when you change your resource models
This project is a work in progress. Resource migrations beyond the initial set up are currently unsupported.
Currently, the only supported database is PostgreSQL. The webserver is written in Node.js using Express.
Try out the example project to see api-pls in action.
Install the api-pls
CLI.
npm install api-pls --global
Next, create a file in the root of your project called .env
. Add the following
line to the file, replacing the database URL with your own:
DATABASE_URL='postgres://user@example.com:5432/example'
Note: It is required that your database has SSL enabled.
Next, you'll need to create resource models. These are the definitions that
describe what tables and endpoints are created for you. Place your resource
models in the directory ./resources
.
More complete documentation for the resource model files is coming soon; for now, refer to the example project.
Once you've defined your resources, run pls migrate
. This will generate
database migrations from your resource models, and then run those migrations.
You're now ready to start an API webserver. Run pls start
to start the server.
You can access the API webserver at localhost:5000
.
Anytime you make changes to your resource models, be sure to run
pls reset-database
to clear out all of the previous models. Presently,
only the initial migrations are supported.
Many thanks goes to Tyler Kellen for his work on Endpoints (which inspired me to write this) and for our many conversations about REST.
FAQs
Effortless JSON API-compliant APIs
The npm package api-pls receives a total of 20 weekly downloads. As such, api-pls popularity was classified as not popular.
We found that api-pls 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.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.