1.4.6 • Published 2 years ago

automaton-server v1.4.6

Weekly downloads
8
License
ISC
Repository
-
Last release
2 years ago

automaton-server

A simple combined file and API server for rapid webapp building.

Usage

npm install automaton-server

Basic Example

import Server from 'automaton-server';

let server = new Server('test', Server.Auth.NO_AUTH);
server
	.serve('/','./public')
	.api('api')
		.get('item/{id:number}', async (reply, {id})=>{
			return await reply.json({id: id});
		});
server.start(80);

Creates a new server with no authentication on localhost (port 80).

  • This server will serve the contents of the local directory /public/ at http://localhost:80/ by default serving index.html at root
  • HTTP GET Requests to http://localhost:80/api/item/17 will get the json response {"id": 17}, note the value 17 has been correctly parsed to a number
1.5.0-b

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.5.0-a

2 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.3.4

3 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago