Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

awebfactory/homepage-backend

Repository files navigation

AWebFactory.com Backend

All-in-one interactive CMS (Content Management System) and SCS (Structured Content Server) based on Strapi.

Customization

Apart from scaffolding in the normal way, with yarn create strapi-app my-project, (without using the --quickstart Sqlite option), and then creating an initial admin user, there are two points of customization:

  • MongoDB is used for development mode, instead of Sqlite
  • As a result I have added support for using .env for server and database configuration, even in development mode

I have followed instructions in this repo based on this Strapi issue .env file is not respected #3558

In my case I am using two extra packages in my package.json:

"dotenv": "^6.2.0",
"find-config": "^1.0.0",

And using the bootstrap function (top of the file) to preload my .env before strapi starts:

require('dotenv').config({ path: require('find-config')('.env') });

from @derrickmehaffy's comment

While .env is of course not tracked, I do include an .env.sample file for reference.

The local file .env is used by development too, since config/environments/development/server.js and config/environments/development/database.js use process.env.{VAR}.