Skip to content

Instantly share code, notes, and snippets.



Last active Aug 16, 2020
What would you like to do?
Server config for Strapi in Serverless
// config/server.js
// This config is used both in `strapi build` and `strapi start`.
// So if we have a path prefix to the api, such as /dev or /v1,
// we need to use env variables to configure, as Strapi doesn't
// support path prefixes automagically.
module.exports = ({ env }) => {
let url = "<Insert Lambda endpoint url here after deploy.>";
// Check if running in serverless-offline
if (env("IS_OFFLINE", null) === "true") {
url = "http://localhost:3000/dev";
return {
host: env("HOST", ""),
port:"PORT", 1337),
admin: {
serveAdminPanel: false, // No admin panel
autoOpen: false,
url: "/",
auth: {
secret: env("ADMIN_JWT_SECRET", "Insert random string as env variable in production"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment