Awesome
You can start Frontity as a node app with
npx frontity build && npx frontity serve
but that starts a local server (localhost:3000).
When using node, you usually need to set up your Apache or Nginx as a reverse proxy in front of node. I have no idea of how to set up Apache or Nginx in SiteGround right now but we have some friends there so I’m going to ask
In the future we’ll release guides to deploy Frontity in different hostings like SiteGround.
In the meantime my recommendation is to use Now where you don’t need to set up Nginx or Apache. The free plan should be more than enough to get you started and you can move back to SiteGround later one.
You don’t need to move your WordPress installation, this is only for Frontity.
We will release a deploy guide to Now the next week with detailed info but if you want to go ahead:
- Install the
now
package in your project:
npm install --save-dev now
- Add this
now.json
file:
{
"version": 2,
"alias": ["frontity.twanneman.nl"],
"builds": [
{
"src": "package.json",
"use": "@now/static-build",
"config": { "distDir": "build" }
},
{
"src": "build/server.js",
"use": "@now/node"
}
],
"routes": [
{
"src": "/static/(.*)",
"headers": {
"cache-control": "max-age=31536000,s-maxage=31536000,immutable"
},
"dest": "/static/$1"
},
{ "src": "/favicon.ico", "dest": "/favicon.ico" },
{
"src": "/(.*)",
"headers": { "cache-control": "s-maxage=1,stale-while-revalidate" },
"dest": "/build/server.js"
}
]
}
- Add a CNAME of
frontity.twanneman.nl
to alias.zeit.co
in your domain DNS settings.
- Deploy Frontity using this command
npx frontity build && npx now --target production
If you have any problem let us know