Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8678437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:43:15+00:00 2026-06-12T20:43:15+00:00

How do make the server reload the Dirty database when it’s trying to get

  • 0

How do make the server reload the Dirty database when it’s trying to get something from it? Because when I edit the database file with a text editor, and reload the browser, it doesn’t update the page.

“reloadDB();” is where I want to reload the db.
Code example

http.createServer(function (request, response) {
    var pathname = url.parse(request.url).pathname;
    var html = db.get(pathname);

    //Check if the requsted file is CSS or JS
    if (/\.(css)$/.test(pathname) || /\.(js)$/.test(pathname)){

        fs.createReadStream(__dirname + pathname, {
            'bufferSize': 4 * 1024
        }).pipe(response);

    } else if (!!html && pathname !== '/admin' ) {
        //Pages from our Dirty DB
        response.writeHead(200, {'Content-Type': 'text/html'});
                    //reloadDB();
        response.end(html);
    } else if (pathname === '/admin') {
        //Display Admin page
        response.writeHead(200, {'Content-Type': 'text/html'});
        response.end('Admin!');
    } else {
        //Show 404 Page
        response.writeHead(404, {'Content-Type': 'text/html'});
        //reloadDB();
                    response.end(db.get('404'));
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:43:17+00:00Added an answer on June 12, 2026 at 8:43 pm

    You just need to call the .Dirty(path) method of your existing instance; if you look at the source, you’ll see that there’s a check allowing Dirty() to be used as either an instance method or a constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make my server to be able to get the name of
I am trying to make a server-client model in which the server can see
I'm trying to make a multithreaded server/client app with java ! this code is
I'm trying to make auto-reload counter (for ex.: Messages [num]). So, I just in
I obviously need to refresh the grid from the server after I create/edit/delete a
When connecting to my server (from a different machine) I get Error Code: 1044
I am trying t use the multihandlesliderextender (from the Ajax Toolkit) to make a
What I must do to make Server.MapPath work? I have using System.Web; what else?
How do I make SQL SERVER 2005 to ignore the backslash in the following
I am learning NodeJS and was able to make a server and an iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.