mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
14 lines
415 B
JavaScript
14 lines
415 B
JavaScript
// Connect to an access point and be a simple web server
|
|
//
|
|
var ssid="guest";
|
|
var password="kolbanguest";
|
|
|
|
var wifi=require("Wifi");
|
|
wifi.connect(ssid, {password: password}, function() {
|
|
console.log("Connected to access point, listening for clients on port 8080.");
|
|
var http = require("http");
|
|
http.createServer(function (req, res) {
|
|
res.writeHead(200);
|
|
res.end("Hello World");
|
|
}).listen(8080);
|
|
}); |