Jayy
Jayy
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Ahh okay awesome
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
What's CJS?
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Oh got you, that's clever
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Okay right, aye, I copied it from there and just removed the type annotations
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Changed it to this, which worked without issue. Is that the correct syntax to use? If so, I can open up a PR for both the examples and documentation 🙂 @Boomeravna
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
const { methods, Route } = require('@sapphire/plugin-api');

class UserRoute extends Route {
constructor(context, options) {
super(context, {
...options,
route: ''
});
}

async run(_, Response) {
return response.json({ message: 'Landing page!' });
}
}

module.exports = {
UserRoute
};
const { methods, Route } = require('@sapphire/plugin-api');

class UserRoute extends Route {
constructor(context, options) {
super(context, {
...options,
route: ''
});
}

async run(_, Response) {
return response.json({ message: 'Landing page!' });
}
}

module.exports = {
UserRoute
};
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Oh, nevermind - that was pleasantly simple!
16 replies
SIASapphire - Imagine a framework
Created by Jayy on 11/22/2024 in #sapphire-support
JS Example has error with loading routes
Thanks for the quick response! I'm guessing the docs need updating too with the new example code for 7.00? Unless the docs are specifically designed for an older version? https://www.sapphirejs.dev/docs/Guide/plugins/API/adding-routes I'll try my best to workout how to fix it, unfortunately I'm very new to Node and Sapphire so might take some time, will try and do a PR 😅
16 replies
SIASapphire - Imagine a framework
Created by Dynamic on 6/25/2024 in #sapphire-support
too much errors
+1 I'm completely new to sapphire, downloaded the started template and got like 20 errors running it. Downgrading fixed it for me
11 replies