Platformatic v0.14.0 - buildServer API, fastify-user, and more

Search for a command to run...

No comments yet. Be the first to comment.
Nitro is a server toolkit used by many JavaScript applications. You can use it on its own for APIs or full-stack servers, or combine it with Vite to get a familiar frontend workflow with a Nitro serve

All durable execution engines give the same versioning advice: pin your runs. Temporal pins runs to worker builds. Vercel's Workflow SDK pins each run to the deployment that started it. Azure Durable

Eve organizes AI agents in a simple way: use Markdown for instructions and skills, TypeScript for tools, and separate files for channels, schedules, and subagents. Behind this setup, Eve relies on the

Picture an online store launching a new product and sending out a mailing list campaign. Thousands of users click the same link at once. The product page, built with a Node.js app like Next.js, needs

How Platformatic ICC Outperforms AWS ECS Target Tracking and Step Scaling

Hi Folks, Happy new year! Platformatic v0.14.0 is out with many bug fixes and improvements. Thanks to all of you that checked us out, testing Platformatic Cloud and are reporting bugs! Hopefully, we fixed some of them in this release!
You can find the full changelog at: https://github.com/platformatic/platformatic/releases/tag/v0.14.0
Thanks to everybody that contributed!
In many cases, it's helpful to start Platformatic DB using an API instead of command line, e.g. in tests, we want to start and stop our server.
The buildServer function allows that:
import { buildServer } from '@platformatic/db'
const db = await buildServer('path/to/platformatic.db.json')
// // Or use a custom configuration
//
// const db = await buildServer({
// server: {
// hostname: '127.0.0.1',
// port: 0
// },
// core: {
// // Use an in-memory database for testing purposes
// connectionString: 'sqlite://./db.sqlite'
// },
// dashboard: true,
// authorization: {
// adminSecret: 'secret'
// }
// })
await db.listen()
const res = await fetch(server.url)
console.log(await res.json())
// do something
await db.stop()
This was implemented in https://github.com/platformatic/platformatic/pull/630
It's now possible to add a custom GraphQL schema during the startup:
{
"core": {
...
"graphql": {
"schemaPath": "path/to/schema.graphql"
}
}
}
}
This was implemented in https://github.com/platformatic/platformatic/pull/632.
In this release, we extracted the fastify-user module from @platformatic/db-authorization. fastify-user provides a Fastify plugin to populate the request.user property from a JWT token (custom claims) or a webhook (response body).
To use it, invoke the extractUser method on the request object, or add this hook:
const app = fastify()
app.register(fastifyUser, {
jwt: {
secret: <my-shared-secret>
}
// // or
// webhook: {
// url: `http://my-webhook-url/authorize`
// }
})
app.addHook('preHandler', async (request, reply) => {
await request.extractUser()
})
This module was developed by @marcopiraccini and extracted in https://github.com/platformatic/platformatic/pull/612.
We did plenty of improvements to our command line interface, check them out:
db seed should try all known config file names by default by @btisdall in https://github.com/platformatic/platformatic/pull/603