Open rajbos opened 4 days ago
That would be most wonderful, I really like repositories with an examples/
folder, I think that the Next.js team really paved the way to show how great it can be:
https://github.com/vercel/next.js/tree/canary/examples
@rajbos thank you for making that suggestion. If you like, you can start by creating the first examples/*
folder and if you get stuck in any way, please reach out for help
I will!
I recently shared a minimal hello world example privately within @github. I figured I'll share it here as well, maybe we can use it as a starting point for examples/hello-world/index.js
import { createServer } from "http";
import {
createTextEvent,
createDoneEvent,
} from "@copilot-extensions/preview-sdk";
const server = createServer((req, res) => {
if (req.method === "GET") {
return res.end("ok");
}
res.write(createTextEvent("Hello, world!"));
res.end(createDoneEvent());
});
const PORT = process.env.PORT || 3000;
server.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Also here is my own app that I've been using to try out all the SDK capabilities: https://github.com/gr2m/app
It's a bit messy but maybe it helps
That link returns a 404 for me.
Draft PR started, please comment if you have remarks on the direction it is going.
That link returns a 404 for me.
sorry it was private, fixed it now
It was quite a hassle to get things started with the SDK, I think it would make it a lot easier if an
example
folder is included that can be executed, basically with the example of 'Talk like a pirate'.I'd be happy to help out with that, either in this repo or in a new one? We can also include an example of running this inside of a Codespace, which works rather nicely. A walk trough would really help there as well.
Let me know your thoughts and I can help out with setting things up.