New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamico is not a function #80
Comments
First of all hi and thanks for trying out Dynamico! :) Could you please give us some more details, what storage are you trying to initiate? You can take a look at this codesandbox which creates a server with filesystem storage |
Hi :) const express = require('express')
const dynamicoMiddleware = require('@dynamico/express-middleware');
const { FSStorage } = require('@dynamico/fs-storage');
const PORT = process.env.PORT || 5000;
const storageProvider = new FSStorage('./components');
const dynamicoMiddleware = dynamico(storageProvider);
const app = express();
app.use('/api/components', dynamicoMiddleware(new FSStorage('./components')));
.listen(PORT, () => console.log(`Listening on ${ PORT }`)) |
Looks like there's actually no Try this const express = require('express')
const dynamicoMiddleware = require('@dynamico/express-middleware');
const { FSStorage } = require('@dynamico/fs-storage');
const PORT = process.env.PORT || 5000;
const app = express();
app.use('/api/components', dynamicoMiddleware(new FSStorage('./components')));
.listen(PORT, () => console.log(`Listening on ${ PORT }`)) |
Ok, also added cors packaged and used it as shown in the codesandbox registry example. |
Can you please try and reproduce on codesandbox? |
Hey @rondeveloper, Can you please try adding to the require statement a reference to the default property? like so: const dynamicoMiddleware = require('@dynamico/express-middleware').default; Since we're just building the code with typescript the way we export the package is not consistent with commonJS. It's a known issue and we plan to solve it in the near future. Thanks for pointing that out. We'll open an issue and link it here. |
Thanks for helping me out with this! @EladBezalel @eladav |
Hey @rondeveloper, As part of our efforts to improve the framework we want to get your feedback on the integration process. We're always happy to get feedback in the form of issues, this helps us improve the product and allows others to contribute. Also, If you're willing to jump on a quick call to tell us about your experience with setting Dynamico up that would be very helpful. By the way, can we close this issue? |
Yes, I'm closing it, I'll be glad to give feedback when I finish the whole setup process of the client/server |
I've started a new server according to the steps in
https://github.com/Soluto/dynamico/blob/master/server/readme.md#Storage
and got the error:
The text was updated successfully, but these errors were encountered: