“Server web node.js” Kode Jawaban

cara membuat server di node js

// code by VARSHITH REDDY SATTI
// to create a server in node.js you should.
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.write("write html code to display you test")
  res.end();
}).listen(8080);
// save this as httpServer.js
// run this by typing node httpServer.js in the command line
// to acess your server got to http://localhost:8080
Crown Of Thorns Starfish

Node JS Server

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
Encouraging Elk

Server web node.js

var http = require('http');

http.createServer(function (req, res) {
	res.write('Hello World!');
    res.end();
}).listen(8080);
Astra Logical

Jawaban yang mirip dengan “Server web node.js”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya