Coder Social home page Coder Social logo

Comments (4)

PerMalmberg avatar PerMalmberg commented on June 20, 2024

You could run a check against some persistent data to see what you should return in the request handler.

I've never thought about the server needing to be shut down but I think just deleting the instance would do it? Haven't checked though.

from smooth.

squonk11 avatar squonk11 commented on June 20, 2024

I think it is better to activate a different page showing a hint how to activate the config page (e.g. by pressing a button). So, the server does not need to be shut down.
But in this case I need to manage two different handlers for the Path "" and switch between these. Is there an easy way to delete a handler which was previously attached to the server via the HTTPServer.on() method?

Edit:
I see that a handler is added to an unordered map using: handlers[method][url] = handler;. So I guess activating a new handler with the same values for "method" and "url" via the on() method will simply replace the old one, correct?

from smooth.

squonk11 avatar squonk11 commented on June 20, 2024

It seems to work like described in the Edit section of my previous post. So I'll close this.

from smooth.

squonk11 avatar squonk11 commented on June 20, 2024

It seems to work like described in the Edit section of my previous post. So I'll close this.

from smooth.

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.