ac-server

A simple http web server in nodejs with express.

Usage no npm install needed!

<script type="module">
  import acServer from 'https://cdn.skypack.dev/ac-server';
</script>

README

ac-server

Install

Usage

ac-server

routes.js

module.exports = {
  upgrade: function(req, socket, head) {
    // probably a websocket connection
  },

  routes: [
    {
      path: '/',
      method: [ 'get', 'post' ], // defaults to 'all'
      fn: function(req, res, next) {
        res.end('Hello World!');
      }
    }
  ]
};