On Fastify
require('dotenv').config();
const { fastify } = require('fastify');
const { createAgent } = require('@forestadmin/agent');
const { createSqlDataSource } = require('@forestadmin/datasource-sql');
const agent = createAgent({
authSecret: process.env.FOREST_AUTH_SECRET,
envSecret: process.env.FOREST_ENV_SECRET,
isProduction: process.env.NODE_ENV === 'production',
});
const app = fastify();
// This function must be called before other middlewares.
await agent.mountOnFastify(app).start();
app.listen(3000);Using Fastify v4.x
Last updated