Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Latest commit

 

History

History
72 lines (46 loc) · 1.91 KB

README.md

File metadata and controls

72 lines (46 loc) · 1.91 KB

Simple Koa static server

wip has moved

Future work on this repository has moved to the monorepo valera-rozuvan/experiments. This repo is archived for historic purposes (to preserve commit history). Navigate over to experiments/simple-koa-static-server to see updates (if any).

introduction

A simple implementation of a Node.js server to host static web application. It uses:

Prerequisites

Initial setup

Run the following commands in the root of this project:

npm install -g forever
npm install

Also, make sure you have built the client side of the application. I.e. you need to have a dist folder where the application static contents will be available.

Updating when package.json changes

All JavaScript dependencies of the project are specified in the file package.json in the root folder. If this file is updated (new dependency is added, or something is removed), you have to run the command:

npm install

to make sure you have all the latest dependencies (the folder node_modules will be updated by this command).

Running the application

Starting of server

To start the server which will be serving the static files from the dist folder, run:

forever start forever.json

Stopping of server

To stop the server which is serving the static files from the dist folder, run:

forever stop skss_server

Server configuration

Please see the file forever.json. It contains the port and the build_dir options. They should be updated to your local defaults.

License

This project is licensed under the MIT license. Please see LICENSE file for more information.