Fixed a configuration issue with the news service
Turns out traefik handles port routing, so the project doesn't need to know the news services' port.
This commit is contained in:
@@ -9,7 +9,13 @@ const NewsEditor = props => {
|
||||
const [index, setIndex] = useState(null);
|
||||
|
||||
if (!articles) {
|
||||
fetch(`${props.uri}/titles?limit=999`, { method: 'GET' })
|
||||
fetch(`${props.uri}/titles?limit=999`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
})
|
||||
.then(a => {
|
||||
if (!a.ok) {
|
||||
throw `Network error ${a.status}: ${a.statusText} ${a.url}`;
|
||||
@@ -107,4 +113,4 @@ const handleSubmit = async (index, title, author, body, uri, newsKey) => {
|
||||
}
|
||||
};
|
||||
|
||||
export default NewsEditor;
|
||||
export default NewsEditor;
|
||||
|
||||
@@ -6,7 +6,13 @@ const NewsFeed = props => {
|
||||
const [articles, setArticles] = useState(null);
|
||||
|
||||
if (!articles) {
|
||||
fetch(props.uri, { method: 'GET' })
|
||||
fetch(props.uri, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
})
|
||||
.then(a => {
|
||||
if (!a.ok) {
|
||||
throw `Network error ${a.status}: ${a.statusText} ${a.url}`;
|
||||
@@ -39,4 +45,4 @@ const NewsFeed = props => {
|
||||
);
|
||||
};
|
||||
|
||||
export default NewsFeed;
|
||||
export default NewsFeed;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ services:
|
||||
- DB_TIMEZONE=${databaseTimeZone}
|
||||
- SESSION_SECRET=secret
|
||||
- SESSION_ADMIN=adminsecret
|
||||
- NEWS_URI=http://${newsWebAddress}:3100/news
|
||||
- NEWS_URI=https://${newsWebAddress}/news
|
||||
- NEWS_KEY=${newsKey}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
Reference in New Issue
Block a user