Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am looking for a relatively simple to use web server like the AsyncWebServer available in Arduino. I need it to run on Windows Visual Studio C++. Any ideas?

What I have tried:

I have investigated using the standard Microsoft webserver but it seems to depend on using .NET
Posted
Updated 5-Apr-23 12:48pm
Comments
Richard MacCutchan 3-Apr-23 9:02am    
What do you mean by "I need it to run on Windows Visual Studio C++."? IIS runs stand-alone on Windows and only uses the default .NET installed libraries.

I think the easiest / quickest way to spin up a HTTP server on your local machine is:
https://www.npmjs.com/package/http-server[^]

It's an npm package -- so you'll need to have node.js and npm (which comes with node.js installation).

So the steps are:

1. (if you don't have node.js) install node.js
2. Install the http-server component globally -- just means you can run it at any time from your console : run the following commnad $ npm install --global http-server
3. run the http-server on any port $ http-server -p 8083
4. Either click the link (shown when you start the http-server) or open a browser and go to http://localhost:8083

That's it!
I use it all the time.

CTRL-C to close the http-server

You can run it from any folder on your machine and that will be the root of the web site.

Nice & easy.
 
Share this answer
 
Take a look at this one: Windows Sockets Streams Part III - HTTP Server[^]. It doesn’t have any external dependencies.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900