-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnext.config.js
55 lines (51 loc) · 1.51 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/** @type {import('next').NextConfig} */
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
const nextConfig = (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER)
return {
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'http',
hostname: '127.0.0.1',
port: '5000',
},
],
},
env: {
API_URL: 'http://127.0.0.1:5000/api',
BOOKS_URL: 'http://127.0.0.1:5000/img/books/',
AUTHORS_URL: 'http://127.0.0.1:5000/img/authors/',
GENRES_URL: 'http://127.0.0.1:5000/img/genres/',
USERS_URL: 'http://127.0.0.1:5000/img/users/',
EBOOK_URL: 'http://127.0.0.1:5000/ebooks/',
AUDIOBOOK_URL: 'http://127.0.0.1:5000/audio-books/',
},
}
const hostnames = [
'bookhive-book.s3.ap-south-1.amazonaws.com',
'bookhive-author.s3.ap-south-1.amazonaws.com',
'bookhive-ebook.s3.ap-south-1.amazonaws.com',
'bookhive-genre.s3.ap-south-1.amazonaws.com',
]
return {
reactStrictMode: true,
images: {
remotePatterns: hostnames.map((hostname) => ({
protocol: 'https',
hostname,
})),
},
env: {
API_URL: 'https://bookhive.up.railway.app/api',
BOOKS_URL: 'https://bookhive-book.s3.ap-south-1.amazonaws.com/',
AUTHORS_URL: 'https://bookhive-author.s3.ap-south-1.amazonaws.com/',
EBOOK_URL: 'https://bookhive-ebook.s3.ap-south-1.amazonaws.com/',
AUDIOBOOK_URL: 'http://127.0.0.1:5000/audio-books/',
GENRES_URL: 'https://bookhive-genre.s3.ap-south-1.amazonaws.com/',
USERS_URL: '',
},
}
}
module.exports = nextConfig