🚧 move to new config based env
This commit is contained in:
parent
8ef0b21819
commit
2cdd1cd961
|
@ -3,4 +3,4 @@
|
|||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
|
||||
public/env.js
|
|
@ -8,6 +8,7 @@
|
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="/src/index.js"></script>
|
||||
<script src="/env.js"></script>
|
||||
<script defer type="module" src="/src/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
11
nginx.conf
11
nginx.conf
|
@ -1,12 +1,9 @@
|
|||
# http {
|
||||
events{}
|
||||
http {
|
||||
include mime.types;
|
||||
# sendfile on;
|
||||
sendfile on;
|
||||
server {
|
||||
root /usr/share/nginx/html;
|
||||
location / {
|
||||
add_header "Set-Cookie" '${APP_CONF}';
|
||||
}
|
||||
|
||||
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
|
||||
expires 1y;
|
||||
add_header Pragma public;
|
||||
|
@ -27,4 +24,4 @@
|
|||
gzip_http_version 1.1;
|
||||
gzip_types application/javascript application/rss+xml application/vnd.ms-fontobject application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/opentype font/otf font/ttf image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;
|
||||
}
|
||||
# }
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
const config = {
|
||||
baseurl: 'http://localhost:4010',
|
||||
// optional params ⏬
|
||||
fallback_username: 'demo',
|
||||
fallback_password: 'demo'
|
||||
};
|
|
@ -1,7 +1,6 @@
|
|||
<script>
|
||||
import store from "../store.js";
|
||||
import { _ } from "svelte-i18n";
|
||||
import { config } from "../dev.env";
|
||||
store.init();
|
||||
import { push, pop, replace } from "svelte-spa-router";
|
||||
//
|
||||
|
@ -24,12 +23,12 @@
|
|||
}).showToast();
|
||||
let username = usersUsername;
|
||||
let password = usersPassword;
|
||||
if (username.length == 0) {
|
||||
username = config.default_username || "demo";
|
||||
}
|
||||
if (password.length == 0) {
|
||||
password = config.default_password || "demo";
|
||||
}
|
||||
// if (usersUsername.length == 0) {
|
||||
username = config.fallback_username || "demo";
|
||||
// }
|
||||
// if (usersPassword.length == 0) {
|
||||
password = config.fallback_password || "demo";
|
||||
// }
|
||||
AuthService.authControllerLogin({
|
||||
username,
|
||||
password,
|
||||
|
|
Loading…
Reference in New Issue