└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Node.JS 24/7 Project Hoster 2 | ### This code is only compatible for node.js. For python, [click me](https://github.com/ItzSidhan/Python-Project-Hoster)! 3 |
4 | 5 | ## Applying 6 | Open your main repl file (example: index.js, app.js, main.js etc...) and at the top and the end of the code, paste this simple code inside: 7 | 8 | Top of the code: 9 | ```js 10 | const keepAlive = require(`./server`); 11 | ``` 12 | 13 | End of the code: 14 | ```js 15 | keepAlive(); 16 | ``` 17 | 18 |
19 |
20 | After that, create a new file named `server.js` and copy paste this code inside the file: 21 | 22 | ```js 23 | const express = require('express'); 24 | const server = express(); 25 | 26 | server.all(`/`, (req, res) => { 27 | res.send(`Please connect me to a hosting website in-order to work 24/7.`); 28 | }); 29 | 30 | function keepAlive() { 31 | server.listen(3000, () => { 32 | console.log(`24/7 Activation Complete`); 33 | }); 34 | } 35 | 36 | module.exports = keepAlive; 37 | ``` 38 | 39 |
40 |
41 | 42 | Finally, connect the web address given at top right corner to a hosting website. I use [freshping](https://app.freshping.io) the most. 43 | 44 |
45 |
46 | 47 | ### Contact me: 48 | 49 | [ItzSidhan | YouTube](https://bit.ly/ItzSidhanYT) 50 | 51 | Discord 52 | 53 | 54 | Twitter 55 | 56 | 57 |
58 | 59 | ### Languages and Tools: 60 | 61 | [JavaScript](https://www.javascript.com/) 62 | [Node.js](https://nodejs.org/en/) 63 | [GitHub](https://github.com/) 64 | [Visual Studio Code](https://code.visualstudio.com/) 65 |
66 |
67 | --------------------------------------------------------------------------------