integrate kontor-angular
This commit is contained in:
@@ -8,6 +8,7 @@ COPY . /app
|
||||
RUN npm run build
|
||||
|
||||
FROM docker.io/library/nginx:stable-alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
server {
|
||||
listen 8700;
|
||||
# Root-Verzeichnis für den Server setzen (wir kopieren unsere Anwendung hierher)
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Definieren der Standard-Indexdatei (Angular erstellt die Datei index.html für uns und sie befindet sich im oben genannten Verzeichnis)
|
||||
index index.html;
|
||||
|
||||
# Cache-Header für Medien-ASsets
|
||||
location ~* \.(?:cur|jpe?g|gif|htc|ico|png|xml|otf|ttf|eot|woff|woff2|svg)$ {
|
||||
access_log off;
|
||||
add_header Pragma "must-revalidate, public";
|
||||
add_header Cache-Control "must-revalidate, public";
|
||||
expires max;
|
||||
|
||||
tcp_nodelay off;
|
||||
}
|
||||
|
||||
# Cache-Header für HTML, CSS und JS-Dateien
|
||||
location ~* \.(?:css|js|html)$ {
|
||||
access_log off;
|
||||
add_header Pragma "must-revalidate, public";
|
||||
add_header Cache-Control "must-revalidate, public";
|
||||
expires 2d;
|
||||
|
||||
tcp_nodelay off;
|
||||
}
|
||||
|
||||
# Konfiguration für den /-Pfad
|
||||
location / {
|
||||
# Zunächst versuchen wir die angeforderte URI auzuliefern
|
||||
# Klappt das nicht, versuchen wir es mit einem abschließenden Slash
|
||||
# Klappt auch das nicht, liefern wir die index.html aus.
|
||||
# Das ist nötig, damit Angular-Routen korrekt augeflöst und ausgeliefert werden
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ const API_URL = "http://localhost:8200/";
|
||||
class AuthService {
|
||||
login(user) {
|
||||
return axios
|
||||
.post(API_URL + "login", {
|
||||
email: user.username,
|
||||
.post(API_URL + "api/login/token", {
|
||||
username: user.username,
|
||||
password: user.password,
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.accessToken) {
|
||||
if (response.data.access_token) {
|
||||
localStorage.setItem("user", JSON.stringify(response.data));
|
||||
}
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user