BILLY
BILLY
TTCTheo's Typesafe Cult
Created by BILLY on 3/17/2024 in #questions
DANGEROUS__uploadFiles
This doesn't import anymore?! What's the alternative?!
3 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
No description
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/25/2023 in #questions
SignalR
Seeking help to start SignalR server using Node. Here's my code: (white lie, I've had chatgpt on call to help resolve but no luck)
const { HubConnectionBuilder, LogLevel } = require("@microsoft/signalr");

// Create an HTTP server
const http = require("http");
const port = 5555;
const server = http.createServer();

// Start the server
server.listen(port, () => {
console.log(`Server started on port ${port}`);
});

// Create a SignalR connection
const hubConnection = new HubConnectionBuilder()
.withUrl(`http://localhost:${port}/chatHub`)
.configureLogging(LogLevel.Information) // Set log level (Information, Debug, etc.)
.build();

// Start the SignalR connection
hubConnection.start()
.then(() => {
console.log(`SignalR server started`);
})
.catch(error => {
console.error(`Error starting SignalR server: ${error}`);
});

// Handle events or messages here
// Example:
hubConnection.on('messageReceived', (user, message) => {
console.log(`Received message from ${user}: ${message}`);
});
const { HubConnectionBuilder, LogLevel } = require("@microsoft/signalr");

// Create an HTTP server
const http = require("http");
const port = 5555;
const server = http.createServer();

// Start the server
server.listen(port, () => {
console.log(`Server started on port ${port}`);
});

// Create a SignalR connection
const hubConnection = new HubConnectionBuilder()
.withUrl(`http://localhost:${port}/chatHub`)
.configureLogging(LogLevel.Information) // Set log level (Information, Debug, etc.)
.build();

// Start the SignalR connection
hubConnection.start()
.then(() => {
console.log(`SignalR server started`);
})
.catch(error => {
console.error(`Error starting SignalR server: ${error}`);
});

// Handle events or messages here
// Example:
hubConnection.on('messageReceived', (user, message) => {
console.log(`Received message from ${user}: ${message}`);
});
Console logs:
Server started on port 5555
[2023-09-25T17:52:40.776Z] Warning: Timeout from HTTP request.
[2023-09-25T17:52:40.778Z] Error: Failed to complete negotiation with the server: Error: A timeout occurred.
[2023-09-25T17:52:40.779Z] Error: Failed to start the connection: Error: Failed to complete negotiation with the server: Error: A timeout occurred.
Error starting SignalR server: Error: Failed to complete negotiation with the server: Error: A timeout occurred.
Server started on port 5555
[2023-09-25T17:52:40.776Z] Warning: Timeout from HTTP request.
[2023-09-25T17:52:40.778Z] Error: Failed to complete negotiation with the server: Error: A timeout occurred.
[2023-09-25T17:52:40.779Z] Error: Failed to start the connection: Error: Failed to complete negotiation with the server: Error: A timeout occurred.
Error starting SignalR server: Error: Failed to complete negotiation with the server: Error: A timeout occurred.
2 replies
TTCTheo's Typesafe Cult
Created by BILLY on 8/12/2023 in #questions
Lucide react
5 replies
TTCTheo's Typesafe Cult
Created by BILLY on 6/6/2023 in #questions
Stripe Webhooks (NextJS App Router)
Is it possible to create a stripe webhook endpoint using nextjs app router? If yes, how?
7 replies
TTCTheo's Typesafe Cult
Created by BILLY on 5/8/2023 in #questions
Next.js metadata title template
My main layout has the example shown in the next.js documentation
export const metadata = {
title: {
default: 'Calendr',
template: `%s | Calendr`,
},
// etc...
}
export const metadata = {
title: {
default: 'Calendr',
template: `%s | Calendr`,
},
// etc...
}
In my page routes I export the following boilerplate:
export const metadata = {
title: 'Page Name'
}
export const metadata = {
title: 'Page Name'
}
The page title stays as the default. Please let me know what you think I should try, many thanks.
7 replies