Something seems wrong with the Content API. Even when I use the Admin API it works fine and returns posts. However the Content API when I use api.posts.browse returns only this message "×
TypeError: GhostContentAPI is not a constructor
Both the Admin API and Content are setup with Nodejs 10.x
And Admins code is almost extactly the same.
// The admin API client is the easiest way to use the API
const GhostAdminAPI = require("@tryghost/admin-api");
// Configure the client
const api = new GhostAdminAPI({
url: "http://localhost:2368",
// Admin API key goes here
key:
".....6dd",
version: "v3"
});
export default api;
The Content is almost exactly the same
const GhostContentAPI = require("@tryghost/content-api");
const content = new GhostContentAPI({
url: "http://localhost:2368",
key: "....062",
version: "v3"
});
export default content;
It but only the content api shows the error. Now I did change it from api to content but even if I use the const api or let api for Content API it still has the same error.
Could this be a bug?