Find Startup Program Folder Using Python Code Get link Facebook X Pinterest Email Other Apps - December 15, 2023 using this code we can find what is locations of startup programs in windowsyou can also find using CTR+Rthen shell:startup Get link Facebook X Pinterest Email Other Apps Comments
Node Js Terminal Password Input - July 25, 2025 const getPassword = ( question = " Enter your Password: ") => { let pass = ""; process . stdout . write ( question ); return new Promise (( reslove , reject ) => { // Setup raw terminal input process . stdin . setRawMode ( true ); process . stdin . setEncoding (' utf8 '); process . stdin . resume (); process . stdin . on (' data ', ( e ) => { if ( e == " \u0003 ") { process . exit ( 0 ) } if ( e . startsWith (' \u001b ')) return ; else if ( e == " \r ") { console . log (""); process . stdin . setRawMode ( false ); process . stdin . pause (); ... Read more
Express Production Setup - 5 | Handle Invaild Json - August 15, 2024 const express = require (" express "); const app = express (); app . use ( express . json ()) // Error handling middleware app . use (( err , req , res , next ) => { if ( err instanceof SyntaxError && err . status === 400 && ' body ' in err ) { res . status ( 400 ). json ({ error: " Invalid JSON " }); } else { next (); // Passes the error to the next error handler if it's not related to JSON parsing } }); app . get (" / ", ( req , res ) => { res . json ( req . body ); }); app . listen ( 3000 , () => console . log (" server running on port 3000 ")); Read more
Express Production Setup - 2 | Rate Limiting | DDOS - August 15, 2024 Simple Rate Limiter In Memory https://github.com/animir/node-rate-limiter-flexible/wiki Visit index.js const express = require (" express ") const initRateLimiter = require (" ./rate-limiter ") const app = express () // add for all route // app.use(initRateLimiter); app . get (" / ", ( req , res ) => { res . send (" hello ") }) // added only for rate route app . get (" /rate ", initRateLimiter , ( req , res ) => { res . send (" ok ") }) app . listen ( 3000 , () => console . log (" app runnning on port 3000 ")) rate-limiter.js const { RateLimiterMemory , RateLimiterRedis } = require (' rate-limiter-flexible '); // Configure the rate limiter const rateLimiter = new RateLimiterMemory ({ ... Read more
Comments
Post a Comment