Giter Site home page Giter Site logo

servez's Introduction

Servez

A simple web server for local web development.

screenshow

Download

Click Here

Choose the .dmg for mac, the .exe for Windows, or the .AppImage for Linux.

What?

Servez is an stand alone app that runs a simple web server. with a GUI to start/stop and choose a folder to serve.

I've worked with many people, often students, who are not comfortable with command lines and certainly not comfortable setting up a big server like Apache.

Servez provides them with an easy way to get started without having to install multiple dependencies nor having to integrate things with their system. No adding to paths, no downloading 3 different pieces of software. Just run and start.

HTTPS

Servez has an option to serve HTTPS. Servez uses a self signed certificate which means your browser will complain that the certificate is not valid. You can click "advanced" on the warning page and then "Proceed to <localhost>" to load the page.

The point of HTTPS support in Servez is to make it easy to access HTTPS only APIs like WebXR etc... Clicking through a warning once in a while is a small tradeoff for automating HTTPS support.

Command Line Arguments

If you want an actual command line version then go here.

Otherwise these are the command line arguments to this app version of Servez.

NOTE! You must include an extra -- by itself before your arguments

servez.exe --port=1234 c:\path\to\serve      # BAD!
servez.exe -- --port=1234 c:\path\to\serve   # good

On Windows the default path is

c:\Users\<username>\AppData\Local\Programs\Servez\Servez.exe

on MacOS the default path is

/Applications/Servez.app/Contents/MacOS/Servez

Usage

servez [options] path/to/serve
  • --help prints the command line arguments

  • -p or --port sets the port as in --port=1234

  • --ssl use HTTPS (see above)

  • --no-dirs don't show directory listings for folders

  • --no-cors don't supply CORS headers

  • --local only allow access from local machine

  • --no-index don't serve index.html for folders

Development

Setup

  • Install node.js

    You can download it here.

  • clone this repo

    git clone https://github.com/greggman/servez.git
    
  • change to the project's folder

    cd servez
    
  • install dependencies

    npm install
    

Organization

main.js          // runs the browser process
src/index.html   // the main window
src/index.js     // JS for the main window
src/style.css    // CSS for the main window

Running

npm start

Will launch with devtools open. Setting the environment variable SERVEZ_ECHO to true will make issue many logging commands in main.js into the log in the app

Building

npm run dist

Will build a file for distribution in the dist folder for the current platform. Note: On MacOS you'll need an Apple Developer account. Then build like this

APPLEID=<your-apple-id> APPLEIDPASS=<see-below-password> npm run dist

For <your-apple-id> instead your Apple ID. Example [email protected] or whatever your Apple ID is.

For <see-below-password> the first step is go to https://appleid.apple.com/ and generate an app specific password. Then, add that password to your keychain with an id of your choosing.

security add-generic-password -a "<your-apple-id>" -w <app-specific-password> -s "<key-id>"

Example:

security add-generic-password -a "[email protected]" -w thea-pppa-sswo-rddd -s "foobar"

From then on, to build

[email protected] APPLEIDPASS=@keychain:foobar npm run dist

During the build it will ask you to give it access to 'foobar'

servez's People

Contributors

greggman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

servez's Issues

Do better CORS

The CORS code is enough for images/video/audio but not enough for scripts

See http-server which uses ecstatic

Port 80

ERROR: listen EACCESS 0.0.0.0:80

Is it possible to run NodeJS scripts with servez?

I'm a beginner in back-end development, currently working on a project where the front-end process everything but at the end it must store everything within a file (I may use more than 100Go so I need to work with a local file outside of the browser)

Servez seems great since it setup all the server easily with only a .exe but is it possible to make it process some server-side scripts through http requests or other way?

FATAL:nss_util.cc(203) nss_error=-5925, os_error=0

The application does not launch on Ubuntu 16.04. Possibly an issue in electron-builder.

$ /home/me/Downloads/Servez-1.0.0-x86_64.AppImage 
2651
[15593:0305/164505.628679:FATAL:nss_util.cc(203)] nss_error=-5925, os_error=0
#0 0x000001ccd51e <unknown>
#1 0x000001cb27cb <unknown>
#2 0x000002e1d29e <unknown>
#3 0x0000007c8aab <unknown>
#4 0x00000073c6b7 <unknown>
#5 0x000000841afb <unknown>
#6 0x000003c557b8 atom::AtomCertVerifier::AtomCertVerifier()
#7 0x000003c3e7e7 atom::AtomBrowserContext::CreateCertVerifier()
#8 0x000003cdced4 brightray::URLRequestContextGetter::GetURLRequestContext()
#9 0x000002b1800c <unknown>
#10 0x000002c326a5 <unknown>
#11 0x000001cb5c2e <unknown>
#12 0x000001d0826c <unknown>
#13 0x000001d08518 <unknown>
#14 0x000001d0887b <unknown>
#15 0x000001cb7f89 <unknown>
#16 0x000001d08007 <unknown>
#17 0x000001cea950 <unknown>
#18 0x000002c277b6 <unknown>
#19 0x000002c27969 <unknown>
#20 0x000001d1fe15 <unknown>
#21 0x000001cfaaa3 <unknown>
#22 0x7f13fec7e6fa start_thread
#23 0x7f13f86c8b5d clone

recent used folders/ports

will be good if it have list for recent folders/ports

or start from CLI with attributes folder , ports

thank you for Servez!

not auto reloading

I can't see my changes automatically after I save them, it would be so great

mssing cached-fake-cert.pem with https on Windows

I tried to hosting with https on Windows and servez complains about the certificate missing. On MacOS everything works just fine. Can someone give me a hint what the issue could be?

ERROR: [object Object] ENOENT, node_modules\servez-lib\lib\cached-fake-cert.pem not found in C:\Users\my_username\AppData\Local\Programs\Servez\resources\app.asar Error: ENOENT, node_modules\servez-lib\lib\cached-fake-cert.pem not found in C:\Users\Tim\AppData\Local\Programs\Servez\resources\app.asar

Edit: using the commandline version installed via npm workes on Windows 10

Possibility to add an alias

Hello there !

You app is really usefull, but the main feature it may be missing is the possibility to serve your folder with an alias.
For example :

http://localhost:15000/myalias/

It is usefull in devlopment to know if you website will survive this simple thing :)

positive feetback from visually impaired user

I would like to thank you very much for yours wonderful application. Fully accessible and it work like A charm. It even show detected IP address inside local network. Ideal tool to test WEB sites and it is even possible to open WEB site on a same local network from various devices at once. Really very well done.

Handling HTTP request

So, I'm wondering if there's a way to make Servez handle HTTP request?

I know the base library uses express at its core, so I'm wondering if there's a feature to handle certain request programmatically instead of providing a file.

The easiest (and crude) way would be to modify the servez-lib itself so it can handle certain pattern as a HTTP request. But I saw a staticOptions about calling a middleware if there's no file, and wondering if I can use it as an entry point.

Start browser with arguments

Just started using Servez to launch Unity WebGL. Does what it says on the tin. Thanks!

My game needs some arguments to say which game to play, turn on logging, etc. Allowing this to be set for browser launch would be handy. Eg

http://localhost:8080/tictactoe?logging=full

folder listings and directories - doesn't add closing "/"

Running Servez to initially show its own automatically generated directory listing, if I then follow a link to a directory, the resulting url is missing the closing slash. So, say from the initial listing I go to a folder called "touch", the URL I land on is http://localhost:8080/touch (no slash). This then messes up any links/calls for resources that use "./", "../" or are called without extra path info as they're in the same directory.

Not sure if this is something that can be fixed here or if it's due to some other component used...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.