Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /* | |
| * Request: Javascript | |
| * | |
| * I would like to learn some basic concepts in JavaScript. Just as example, making a stopWatch and creating a racing game with few players which will have start and stop time for each player and choose one winner from them using the stopWatch object. | |
| */ | |
| // Design and Code a StopWatch | |
| // Sample Use Case: | |
| // var sw = new StopWatch(); | |
| // sw.start().stop().start().log(); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /** | |
| * Axios Request Wrapper | |
| * --------------------- | |
| * | |
| * @author Sheharyar Naseer (@sheharyarn) | |
| * @license MIT | |
| * | |
| */ | |
| import axios from 'axios' |
| upstream fuel { | |
| # Defines a group of servers. Servers can listen on different ports. | |
| server IP:PORT fail_timeout=0; | |
| } | |
| upstream frontend { | |
| server IP:PORT fail_timeout=0; | |
| } |
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |