Sharing Server Actions between projects

Just wanted to check if this was actually possible before i do it, but I often seem to find myself making the same or very similar server actions over and over again, on almost every project I have done. Is it possible for me to just go and copy the server actions from the api path, and paste them into my new project, then adjust the connection settings and be able to use it in my new project.

I am unsure if certain server actions add bits to the config file or any other place, so I would rather not do it if it is going to cause a problem I am unaware of.

I often do this, without any problems.

1 Like

Thanks Tom, I wonder if that means we could share server actions amongst the community, if we remove the private information?

Yes, I think we could. However the more complicated server actions would probably be too solution-specific to be of general interest; the simpler ones are more likely to be generic and generally applicable, but probably also quite simple to create from scratch. Having said that, I copy and paste basic CRUD action files for example, for my own purposes, so perhaps you have a point. In any case, I’m always interested to see examples which appear on this forum - in discussions and screenshots etc.

1 Like

That’s why i suggested some time ago that there be a “default connection” defined in the target so server actions could be truly portable, just share with the connection set to “default”

2 Likes

I don’t see how this would make much difference to the ease or otherwise of sharing server connect files. I would have thought the main issue was the database schema used in the server connect file which was to be shared.

2 Likes

Both Brian and Paul make sense.
I have gone into connection files & actions in one project and copy & pasted relevant parts into files in another project. It DOES SAVE TIME.

Sometimes just adding the whole files to another project where the tables are similar or identical, or where the referenced database at a particular hosting account (I have 5) is the same in another project.

And, of course editing some variables in connections or actions files.

It would be nice if some commonly used connections, for instance, could be saved as globals applicable to different projects where the same starting settings are used over & over.

And if REUSABLE actions & flows could be saved via Wappler in an organized fashion.

A code snippets facility, as requested here, would go some towards this and would be relatively easily to implement I would have thought. There are all sorts of things I copy/paste between pages and/or sites. It can even save time copy/pasting a single field validation between pages - but would be better still to have an organised repository of such things.

1 Like

With or without Docker it would be possible to pass along whole Installation Demos of a Wappler application.

There’s actually no Demo bundled with Wappler that relies on a MySQL database installation to retrieve & store data.

It would be an invaluable learning tool to accompany a Tutorial.
To install the files needed for a Tutorial on how to create a particular application with some sophisticated flows, etc.

One zipped file including the Install mysql database queries.

That IS one thing that is completely portable & installable from Wappler project folders.