GithubHelp home page GithubHelp logo

Comments (6)

rawtaz avatar rawtaz commented on July 17, 2024

I was thinking about this today as well.

I think to keep it simple you just need to be able to supply multiple --path arguments, one per path you want to have repositories in, each having its own .htaccess file. The server could simply look for the user in the first path/mux, and if it's not found there look in the next one you specified, etc.

One can start with the requirement that usernames must be unique over all paths (otherwise the first one will be used). So e.g. if user foo exists in both of two paths, when /foo is used as the path in the URL, the first path's user is used, and the data is stored there.

I don't think the other arguments need to be per-path, let's keep it simple.

from rest-server.

mholt avatar mholt commented on July 17, 2024

Specifically, I want a NewMux() to be associated with its own Config -- it has nothing to do with Config.Path in particular, and my use case definitely doesn't have anything to do with .htaccess files.

Maybe something like restserver.NewMux(restConfig) where restConfig := restserver.Config{...}. But I'm not sure how to attach the mux to the config.

from rest-server.

rawtaz avatar rawtaz commented on July 17, 2024

Well, I was discussing the user interface. Regardless how you build the internals, people still need to be able to supply the configuration when starting rest-server, I presume.

Yes, some kind of injecting the config to use into the Mux seems like the way to go.

from rest-server.

mholt avatar mholt commented on July 17, 2024

I think we're talking about two different things then; I am using rest-server as a library, so there is no user interface in my case. But I can understand the need to bridge the two.

from rest-server.

rawtaz avatar rawtaz commented on July 17, 2024

Got ya. I for some reason presumed that it would be something that should be exposed on the command line as well, but I understand you're just looking at the internals then. I think once those are in place it's a pretty small thing to make it accessible through the CLI as well. So never mind me.

from rest-server.

fd0 avatar fd0 commented on July 17, 2024

This is a good idea, a singleton config is not great. Thanks for working on this!

from rest-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.