Forge Server explained

jamstack

#1

We recently announced a brand new Forge Server. This is currently live and in beta, available to all Forge users.

##Enabling Forge Server

To enable Forge Server for your site, you just need to include a valid .forgerc file into your Forge project before you upload it.

When deploying, you’ll see in the Forge Console that Forge has picked up your config and is using it.

The Forge-Server is open source and has an extendible plugins directory, where you can write your own plugins.

I look forward to discussing the evolution of Forge Server here…

If you have any problems using the beta, or have any suggestions, please see the :tools: Github repo or :bug: Bug reports using Github Issues

##Current Example Uses:

You would probably need .forgerc file on your site if you want to reuse pages across different URLs or you want better looking links. This can be achieved with Redirect/Rewrite rules. E.g.:

Location /our-team
  Rewrite /our-team.html

We imagine you’d want to give a link to your site with terms and conditions. You’re too busy at the moment to design specific page, so instead just redirect users to a Google Doc (replace it with your own page, the link will remain the same!).

Location /terms
  Redirect https://docs.google.com/document/d/1_n1_oiyk0b3x7i69n-iAh4f0UmFbvA 302

You don’t even need a page, you can write a quick text placeholder directly in the config file:

Location /terms
  Respond "Oops! Not ready yet, stay tuned." 200

Use NotFound condition if you want to display custom 404 page (Forge already supports 404.html out of box, but say you need another name).

NotFound
  Rewrite /my-custom-404.html

This condition is also useful if you have a single-page application with pushState routing. In order to make your app work when it refreshes, you need to respond with index.html on any unknown request.

NotFound
  Rewrite /index.html