How can make web page in termux? | SoloLearn: Learn to code for FREE!

0

How can make web page in termux?

1/23/2021 2:30:32 PM

Javoxir Xolmirzayev

9 Answers

New Answer

+2

Thank you, sir!🤝

+1

1. install node js, 2. create a directory 3. cd directory 4. npm init //accept all the defaults 5.npm install express 6.create a index.js file 7.place the following code inside index.js in order to start a server that can serve static web pages. ------------------------- const express = require("express"); const app = express(); const port = 3000; app.use(express.static("public")) , /*app.listen(port, () => { console.log(`server listening at ${port}`); });*/ ------------------- 8. create a public folder and place your html js and css files there. 9. Start the server by following command: node index. js Now go to url, http://localhost: portNumber/ file.html To see your web page.

+1

+1

You do not need to use either Termux or Node.JS to create a web page. You can create a web page with any text editor that you have on your device. Nothing more is needed. A web page is simply an HTML document. You may optionally add JavaScript and CSS to the page. These additional documents can either be embedded within the HTML document or linked as external documents. The instructions Abhay has provided details how to install node.js, express.js, and launch a web server. At no point does it explain how to create a web page.

+1

install python: > apt-get install python go to your web folder root: > cd www run python http server module at root of your web folder: > python -m http.server 8080 this will run a web server to port 8080 (could be what you want) for all your private network. if you want only accept localhost connections: > python -m http.server 8080 --bind 127.0.0.1 go to a browser, and type "127.0.0.1:8080" in the address bar... (at least actual firefox mobile doesn't support "localhost")

+1

How can i do termux as code editor.

+1

Javoxir Xolmirzayev, You do not need Termux to use a text editor. Termux is an Android terminal program aand Linux environment application. The only reason to use Termux is if you wish to use Linux console tools on an Android device. Termux is also big, at least 200 MB, even more when you start adding additional features. It's overkill as a web page editor. I've always used Jack Palevich's Terminal Emulator for Android (551 KB) as a terminal emulator and the device's built in busybox/toybox/toolbox command set. There are plenty of html and code editors available on the play store that do not require the kind of space that Termux does. Though if you insist on using Termux then please take a look at the Termux wiki https://wiki.termux.com/wiki/Main_Page

0

Your welcome, no need to call me sir tho! :)

0

try: > nano [filename.ext] if not installed: > apt-get install nano then: > nano [filename.ext]