Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fizzygalacticus/starkserver
A very basic NodeJS web server.
https://github.com/fizzygalacticus/starkserver
easy-to-use javascript node-js nodejs server webserver
Last synced: 9 days ago
JSON representation
A very basic NodeJS web server.
- Host: GitHub
- URL: https://github.com/fizzygalacticus/starkserver
- Owner: FizzyGalacticus
- License: apache-2.0
- Created: 2016-05-12T23:58:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-18T00:01:01.000Z (over 7 years ago)
- Last Synced: 2023-12-27T09:02:34.357Z (11 months ago)
- Topics: easy-to-use, javascript, node-js, nodejs, server, webserver
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# StarkServer
StarkServer is a simple, easy to use, and highly configurable web server written for NodeJS. I wanted a way to have a website up in seconds, without all of the extra gunk offered by other webservers.
With StarkServer, you can:
* Specify certain filetypes you'd like to serve.
* Host multiple domains from the same server (virtual hosts).
* Serve over HTTP and HTTPS.
* Easily write new Drivers to output to the web in *any* language.### Tech
StarkServer uses the following technologies to serve your pages:
* [node.js]
- fs
- path
- http
- https
- recursive-readdir
- mime-types
- simple-node-logger### Installation
StarkServer requires [Node.js](https://nodejs.org/) v4.5+ to run.
Download and extract the [latest release](https://github.com/FizzyGalacticus/StarkServer/archive/master.zip).
Install the dependencies.
```sh
$ cd StarkServer
$ npm install
```### Configure
There exists a JSON config file that is already setup with the options that are needed, just with generic inputs. You will need to make sure the ports are the ones you wish to bind to, the baseDirectory is set (the directory of your website), and any Drivers are setup if you need them. An example from my config looks like this:```js
var config = {
ports: {
http: 80,
https:443
},
ssl: {
cert:'/home/www/certs/fullchain.pem',
key: '/home/www/certs/key.pem'
},
domains: {
localhost:{
host :['localhost', '127.0.0.1', 'hostname'],
baseDirectory :'/home/www/mywebsite',
allowedFileTypes:['js','css','html'],
index:'index.html',
filesToIgnore: ['.gitignore'],
directoriesToIgnore:['.git']
}
},
drivers: {
name: {
DriverFile: 'drivers/php.js',
fileTypes:['php']
}
}
};module.exports = config;
```### Run
Running the following should begin the server with your configurations.
```sh
$ node run.js
```If this fails, try running as root/administrator. By default, you must be root to bind to port 80 and 443.
```sh
$ sudo node run.js
```### Development
Want to contribute? That would be awesome!
I use [Waffle.io](https://waffle.io/FizzyGalacticus/StarkServer) to keep track of issues for this project.
License
-------Apache 2.0