Skip to content
Advertisement

Middleware “strapi::session”: App keys are required. Please set app.keys in config/server.js (ex: keys: [‘myKeyA’, ‘myKeyB’])

Trying to set up strapi and cloudinary I watched two videos and they are all OK, but I have an error, tell me why?

Middleware “strapi::session”: App keys are required. Please set app.keys in config/server.js (ex: keys: [‘myKeyA’, ‘myKeyB’])

enter image description here

plugins.js

JavaScript

.env

JavaScript

server.js

JavaScript

middlewares.js

JavaScript

admin.js

JavaScript

Advertisement

Answer

It looks like you don’t have APP_KEYS defined in your .env file (assuming you’re sharing the full file), as well as some other env variables you’re accessing using strapi’s built in env utility.

In your .env you should have a value for the following that should follow this format:

JavaScript

You can read more about environment config from Strapi’s development docs: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#strapi-s-environment-variables

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement