adding robots.txt
This commit is contained in:
@@ -15,6 +15,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
|
||||
|
||||
COPY nginx.conf.template /etc/nginx/nginx.conf.template
|
||||
COPY nginx_setup.conf.template /etc/nginx/nginx_setup.conf.template
|
||||
COPY robots.txt /etc/nginx/html/robots.txt
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -53,6 +53,12 @@ http {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location = /robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location ~ /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
@@ -26,16 +26,14 @@ let len = 0;
|
||||
async function fetchPosts() {
|
||||
try {
|
||||
const res = await axios.get("/api/posts");
|
||||
if (Array.isArray(res.data)) {
|
||||
posts = res.data;
|
||||
len = posts.length;
|
||||
post.value = posts[0];
|
||||
userOwnsPost.value =
|
||||
post.value.author.username == auth.user.username;
|
||||
leftCap.value = true;
|
||||
} else {
|
||||
throw new Error("Invalid response from API");
|
||||
if (!Array.isArray(res.data)) {
|
||||
throw new Error("Invalid response from posts API");
|
||||
}
|
||||
posts = res.data;
|
||||
len = posts.length;
|
||||
post.value = posts[0];
|
||||
userOwnsPost.value = post.value.author.username == auth.user.username;
|
||||
leftCap.value = true;
|
||||
} catch (err) {
|
||||
console.log("Cannot connect to API");
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ const idx = ref(0);
|
||||
async function fetchRecent() {
|
||||
try {
|
||||
const res = await axios.get("/api/spotify/recent");
|
||||
if (Array.isArray(res.data)) {
|
||||
songs.value = res.data;
|
||||
idx.value = 0;
|
||||
} else {
|
||||
if (!Array.isArray(res.data)) {
|
||||
throw new Error("Invalid response from Spotify API");
|
||||
}
|
||||
|
||||
songs.value = res.data;
|
||||
idx.value = 0;
|
||||
} catch (err) {
|
||||
console.error("Cannot connect to Spotify API", err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user