chore: migrate project tooling to bun and add eslint linting
This commit is contained in:
@@ -112,7 +112,6 @@ async function start() {
|
||||
}
|
||||
|
||||
shuttingDown = true;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`received ${signal}, shutting down`);
|
||||
|
||||
server.close();
|
||||
@@ -127,14 +126,12 @@ async function start() {
|
||||
});
|
||||
|
||||
server.listen(config.port, () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`xartaudio server listening on :${config.port}`);
|
||||
});
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
start().catch((error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("failed to start server", error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
@@ -198,18 +198,15 @@ function renderAudioPage({ audio, accessDecision, userId }) {
|
||||
});
|
||||
}
|
||||
|
||||
let action = "";
|
||||
if (accessDecision.allowed) {
|
||||
action = `<div class="alert alert-success">Access granted. This unlock is permanent for your account.</div>`;
|
||||
} else if (accessDecision.reason === "auth_required") {
|
||||
action = `<div class="alert alert-warning mb-3">Sign in to continue.</div>
|
||||
<a href="/login?returnTo=/audio/${audio.id}" class="btn btn-primary">Sign in to unlock</a>`;
|
||||
} else {
|
||||
action = `<div class="alert alert-warning mb-3">Unlock required: ${accessDecision.creditsRequired} credits.</div>
|
||||
const action = accessDecision.allowed
|
||||
? `<div class="alert alert-success">Access granted. This unlock is permanent for your account.</div>`
|
||||
: accessDecision.reason === "auth_required"
|
||||
? `<div class="alert alert-warning mb-3">Sign in to continue.</div>
|
||||
<a href="/login?returnTo=/audio/${audio.id}" class="btn btn-primary">Sign in to unlock</a>`
|
||||
: `<div class="alert alert-warning mb-3">Unlock required: ${accessDecision.creditsRequired} credits.</div>
|
||||
<form method="POST" action="/audio/${audio.id}/unlock">
|
||||
<button class="btn btn-primary">Pay ${accessDecision.creditsRequired} credits and unlock forever</button>
|
||||
</form>`;
|
||||
}
|
||||
|
||||
return shell({
|
||||
title: `${escapeHtml(audio.articleTitle)} | XArtAudio`,
|
||||
|
||||
Reference in New Issue
Block a user