Skip to content

Add endpoint for suggested instance (fixes #581) #586

Open
Nutomic wants to merge 11 commits intomainfrom
suggested-instance-api
Open

Add endpoint for suggested instance (fixes #581) #586
Nutomic wants to merge 11 commits intomainfrom
suggested-instance-api

Conversation

@Nutomic
Copy link
Member

@Nutomic Nutomic commented Feb 9, 2026

No description provided.

"markdown-it-ruby": "^1.1.1",
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"maxmind": "^5.0.5",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like these two libraries are breaking the build: https://woodpecker.join-lemmy.org/repos/128/pipeline/1886/7

express.static(path.resolve("./dist/assets/lemmy_federation_context.json")),
);
server.use("/feed.xml", express.static(path.resolve("./dist/feed.xml")));
server.use("/api/v1/instances/suggested", suggested);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has some overlap with the routes for api documentation.

@Nutomic Nutomic marked this pull request as ready for review February 11, 2026 09:39
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me adding all the IP and geo stuff seems way overkill. Just serialize the suggested instances and ignore all the IP / location considerations.

@Nutomic
Copy link
Member Author

Nutomic commented Feb 12, 2026

We need that to find out which country the current user IP belongs to. How else do you propose to match the user and instance locations?

@Nutomic Nutomic force-pushed the suggested-instance-api branch from f90515f to 93efcb4 Compare February 12, 2026 09:33
@dessalines
Copy link
Member

Its up to you I spose, but really I'd rather this endpoint serialize all the recommended instances (including the suggested flag I added).

To me the main use case of this endpoint, is so that apps don't have to hardcode a large list of instances in their dropdown for choosing an instance inside their app. The instances_metadata list contains all the info that join-lemmy uses, that apps could also use to create their own in-app instance pickers / dropdowns / list.

@Nutomic
Copy link
Member Author

Nutomic commented Feb 16, 2026

That can be a separate endpoint. Normally users shouldnt have to choose an instance manually at all, and simply use the suggested one. The signup UI I'm thinking about would look like this:

Register on example.com
Username: ...
Password: ...
Other inputs
Register | Browse all instances

Edit: Added endpoint /api/v1/instances/all. Cant test it yet due to the error from package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants