❀フレイア❀
❀フレイア❀
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
https://www.littlekittlylove.xyz/ but i have problem with navbar When using it in the computer, everything seems normal. Until I took it to the VPS and the button didn't work.
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
No description
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
after createResource, i can use it to all page ?
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
import { Suspense, createSignal } from "solid-js";
import { Nav } from './component/nav'
import axios from 'axios';
import {
Body,
ErrorBoundary,
FileRoutes,
Head,
Html,
Meta,
Routes,
Scripts,
Title,
} from "solid-start";
import "./root.css";

export default function Root() {
const [data, setData] = createSignal("");

async function fetchData() {
const response = await axios.get('http://localhost:3001/api/data');
setData(response.data);
}

fetchData();

return (
<Html lang="th" className="scroll-smooth hover:scroll-auto md:scroll-auto">
<Head>
<Title>{data().title || 'กำลังดึงข้อมูล'}</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<Meta property="og:title" content={data().title} />
<Meta property="og:description" content={data().message} />
<Meta name="description" content={data().message}/>
<Meta name="author" content="เฟรย์ย่าฮิเมะเองเจ้าคร๊า" />
<link href="https://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,400,400i,700,700i,900,900i" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Mitr:wght@300&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="dist/sakura.css" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<Nav />
<Routes>
<FileRoutes />
</Routes>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
);
}
import { Suspense, createSignal } from "solid-js";
import { Nav } from './component/nav'
import axios from 'axios';
import {
Body,
ErrorBoundary,
FileRoutes,
Head,
Html,
Meta,
Routes,
Scripts,
Title,
} from "solid-start";
import "./root.css";

export default function Root() {
const [data, setData] = createSignal("");

async function fetchData() {
const response = await axios.get('http://localhost:3001/api/data');
setData(response.data);
}

fetchData();

return (
<Html lang="th" className="scroll-smooth hover:scroll-auto md:scroll-auto">
<Head>
<Title>{data().title || 'กำลังดึงข้อมูล'}</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<Meta property="og:title" content={data().title} />
<Meta property="og:description" content={data().message} />
<Meta name="description" content={data().message}/>
<Meta name="author" content="เฟรย์ย่าฮิเมะเองเจ้าคร๊า" />
<link href="https://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,400,400i,700,700i,900,900i" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Mitr:wght@300&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="dist/sakura.css" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<Nav />
<Routes>
<FileRoutes />
</Routes>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
);
}
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
No description
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
no data onweb but console.log(data.message) have data
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
No description
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
backend.jsx
import { createSignal, onCleanup } from 'solid-js';

export default function Backend() {
const [message, setMessage] = createSignal("");

async function fetchData() {
const response = await fetch('/api/data');
const data = await response.json();
setMessage(data.message); // เปลี่ยนเป็น data.message เพื่อดึงข้อความจาก property message ในอ็อบเจ็กต์ data
console.log(data.message)
}

fetchData();

return (
<div>
<h1 class="text-cyan">Backend Page</h1>
<pre>{message()}</pre>
</div>
);
}
import { createSignal, onCleanup } from 'solid-js';

export default function Backend() {
const [message, setMessage] = createSignal("");

async function fetchData() {
const response = await fetch('/api/data');
const data = await response.json();
setMessage(data.message); // เปลี่ยนเป็น data.message เพื่อดึงข้อความจาก property message ในอ็อบเจ็กต์ data
console.log(data.message)
}

fetchData();

return (
<div>
<h1 class="text-cyan">Backend Page</h1>
<pre>{message()}</pre>
</div>
);
}
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
vite.config.js
import solid from "solid-start/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [solid()],
server: {
proxy: {
'/api': 'http://localhost:3001',
}
}
})
import solid from "solid-start/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [solid()],
server: {
proxy: {
'/api': 'http://localhost:3001',
}
}
})
20 replies
SSolidJS
Created by ❀フレイア❀ on 8/15/2023 in #support
I don't understand why I get this kind of error.no matter which method you try
server.js
const express = require('express');
const app = express();
const cors = require('cors');
const { Client, Events, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
require('dotenv').config()



client.once(Events.ClientReady, () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login(process.env.TOKEN);


app.use(cors());
app.get('/api/data', (req, res) => {
const data = {
message: 'Hello from the backenddddddd!',
title: '💮👑ชมรมคนเหงา🎮💘',
ping: `${client.ws.ping}`
};
res.json(data);
});

const port = process.env.PORT || 3001;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
const express = require('express');
const app = express();
const cors = require('cors');
const { Client, Events, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
require('dotenv').config()



client.once(Events.ClientReady, () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login(process.env.TOKEN);


app.use(cors());
app.get('/api/data', (req, res) => {
const data = {
message: 'Hello from the backenddddddd!',
title: '💮👑ชมรมคนเหงา🎮💘',
ping: `${client.ws.ping}`
};
res.json(data);
});

const port = process.env.PORT || 3001;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
20 replies