Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/********* Pleasedontcode.com ********** Pleasedontcode thanks you for automatic code generation! Enjoy your code! - Terms and Conditions: You have a non-exclusive, revocable, worldwide, royalty-free license for personal and commercial use. Attribution is optional; modifications are allowed, but you're responsible for code maintenance. We're not liable for any loss or damage. For full terms, please visit pleasedontcode.com/termsandconditions. - Project: **Async Server** - Source Code NOT compiled for: ESP32 DevKit V1 - Source Code created on: 2024-10-14 20:59:13 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* adjust baseline code to convert code using */ /* espasyncwebserver and SPIFFS. Let's consider that */ /* javascript code is already integrated in html */ /* file. */ /****** END SYSTEM REQUIREMENTS *****/ /* START CODE */ /****** DEFINITION OF LIBRARIES *****/ #include
//https://github.com/dvarrel/ESPAsyncWebSrv #include
// Include the FS library for SPIFFS #include
// Include the SPIFFS library /****** FUNCTION PROTOTYPES *****/ void setup(void); void loop(void); /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/ AsyncWebServer server(80); // Create an instance of the server void setup(void) { // Initialize Serial for debugging Serial.begin(115200); // Initialize SPIFFS if (!SPIFFS.begin(true)) { Serial.println("SPIFFS Mount Failed"); return; } // Serve static files from SPIFFS server.serveStatic("/", SPIFFS, "/").setDefaultFile("index.htm"); // Handle not found requests server.onNotFound([](AsyncWebServerRequest *request){ request->send(404, "text/plain", "Not found"); }); // Start the server server.begin(); } void loop(void) { // Main code to run repeatedly } /* END CODE */
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)