Hi! I can’t run and work with data on my express app. Same problem I had with NestJS and forestadmin/agent.
I have latest version of forest-express-moongoose.
require("dotenv").config();
const express = require("express");
const app = express();
const forest = require("forest-express-mongoose");
const mongoose = require("mongoose");
(async () => {
await mongoose.connect('mongodb://127.0.0.1:27017/test')
app.use((req, res, next) => {
console.log(`Req: ${req.method} - ${req.url}`);
next();
});
app.use(
await forest.init({
authSecret: process.env.FOREST_AUTH_SECRET,
envSecret: process.env.FOREST_ENV_SECRET,
objectMapping: mongoose,
connections: {
default: mongoose.connection,
},
})
);
app.use(express.json());
app.get("/", (req, res) => res.send("OK"));
app.listen(8000, () => console.log("started"));
})();
What I get in admin panel:
Documentation is helpless for me. Does anybody has a working example repo with latest forest lib?