Destack has are 2 main components:
- A React component that shows the editor in
development
and the rendered page inproduction
. - A local server that loads and saves the user page data and serves the theme files.
The local server supports 3 query types:
- The
data
type which loads and saves the user page data - The
asset
type which serves specific assets (that's onlyimage/png
now) - The
theme
type which loads the themeHTML
source code
- The React component can be imported in any Next.js route in the
pages
folder. Indevelopment
the component calls the local server throughlocalhost
as the server is hosted as a Next.js API route. Inproduction
it loads the user page data using Next.jsgetStaticProps
. - The local server uses Next.js API routes and serve the endpoints mentioned above.
- The React component can be imported in
index.js
or any sub-component but user should handle routing themselves (eg. withreact-router-dom
). Indevelopment
the component calls the local server throughlocalhost
on port12785
. That server is started withdestack -d
helper script. Inproduction
the user page data is loaded withdestack -b
helper script. - The local server is a standalone Node.js script with
express
in contrast to Next.js version above but it server the same endpoints mentioned in the overview.