Code Monkey home page Code Monkey logo

Comments (3)

mholt avatar mholt commented on August 27, 2024 1

1st I need to use the auto_https disable_redirects or else it throws error.

What error?

Is there any plugin or utility which can help to configure this local domains automatically?

I've often thought this would make a great Caddy plugin :) If anyone wants to build it!

But for now I've found that editing a hosts file is not a bad way to go.

from caddy.

rahulmr avatar rahulmr commented on August 27, 2024 1

There is a good npm package which does this - https://www.npmjs.com/package/hotel

I am not so good yet in developing something on my own like the plugin you said. But yes if this kind of plugin is there, it will boon for developers to test an app locally.
Also, a good use case could be creating MVPs for client, where they can actually mock the website locally. But again as you said, modifying hosts file in windows is also a good option but the problem with it is we cannot configure wildcard domains.
like below

127.0.0.4 *.test.local

something like hotel can be incredible addon (plugin) for local development.

Anyways, thanks again for your wonderful work and quick responses.

from caddy.

rahulmr avatar rahulmr commented on August 27, 2024

Got a different solution, please close the issue if you want. I was able to work with below configuration.

{
	auto_https disable_redirects
}
localhost {
	respond "Caddy server is running "
}

localhost:2016 {
	respond "Hello World !!! !!!"
}

test.localhost {
	respond "testing test.localhost domain"	
}

myserver-127-0-0-6.sslip.io {
	respond "checking sslipio for local sites"
	tls internal
}

from caddy.

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.