Skip to content

Commit fc2393a

Browse files
authored
Upgrade to Strapi v4 (#9)
1 parent 28ccd88 commit fc2393a

File tree

21 files changed

+4552
-4436
lines changed

21 files changed

+4552
-4436
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
HOST=0.0.0.0
22
PORT=1337
3+
APP_KEYS=tempkey
4+
JWT_SECRET=tempsecret
5+
ADMIN_JWT_SECRET=tempsecret

config/admin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = ({ env }) => ({
2+
auth: {
3+
secret: env('ADMIN_JWT_SECRET', 'b4dbad35-6caa-4f84-be56-90d0d3bc2fdf'),
4+
},
5+
});

config/database.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1+
const path = require('path');
2+
13
module.exports = ({ env }) => ({
2-
defaultConnection: 'default',
3-
connections: {
4-
default: {
5-
connector: 'bookshelf',
6-
settings: {
7-
client: 'sqlite',
8-
filename: env('DATABASE_FILENAME', '.tmp/data.db'),
9-
},
10-
options: {
11-
useNullAsDefault: true,
12-
},
4+
connection: {
5+
client: 'sqlite',
6+
connection: {
7+
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
138
},
9+
useNullAsDefault: true,
1410
},
1511
});

config/env/production/database.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ module.exports = ({ env }) => {
44
const { host, port, database, user, password } = parse(env("DATABASE_URL"));
55

66
return {
7-
defaultConnection: "default",
8-
connections: {
9-
default: {
10-
connector: "bookshelf",
11-
settings: {
12-
client: "postgres",
13-
host,
14-
port,
15-
database,
16-
username: user,
17-
password,
18-
},
7+
connection: {
8+
client: "postgres",
9+
connection: {
10+
host,
11+
port,
12+
database,
13+
user,
14+
password
1915
},
16+
debug: false,
2017
},
2118
};
2219
};

config/env/production/middleware.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/env/production/server.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
module.exports = ({ env }) => ({
2-
host: "0.0.0.0",
32
url: env("RENDER_EXTERNAL_URL"),
4-
admin: {
5-
auth: {
6-
secret: env("ADMIN_JWT_SECRET"),
7-
},
8-
},
93
});

config/functions/bootstrap.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

config/functions/cron.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

config/functions/responses/404.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/middlewares.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = [
2+
"strapi::errors",
3+
"strapi::security",
4+
"strapi::cors",
5+
"strapi::poweredBy",
6+
"strapi::logger",
7+
"strapi::query",
8+
"strapi::body",
9+
'strapi::session',
10+
"strapi::favicon",
11+
"strapi::public",
12+
];

0 commit comments

Comments
 (0)