You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Docs
|
|
|
|
|
|
|
|
![WeTTy](./terminal.png?raw=true)
|
|
|
|
|
|
|
|
- [Running as daemon](./service.md)
|
|
|
|
- [SSL Support](./ssl.md)
|
|
|
|
- [Using NGINX](./nginx.md)
|
|
|
|
- [Using Apache](./apache.md)
|
|
|
|
- [Automatic Login](./auto-login.md)
|
|
|
|
- [Downloading Files](./downloading-files.md)
|
|
|
|
- [Development Docs](./development.md)
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
For WeTTy options and event details please refer to the [api docs](./API.md)
|
|
|
|
|
|
|
|
### Getting started
|
|
|
|
|
|
|
|
WeTTy is event driven. To Spawn a new server call `wetty.start()` with no
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
const wetty = require('wetty.js');
|
|
|
|
|
|
|
|
wetty
|
|
|
|
.on('exit', ({ code, msg }) => {
|
|
|
|
console.log(`Exit with code: ${code} ${msg}`);
|
|
|
|
})
|
|
|
|
.on('spawn', msg => console.log(msg));
|
|
|
|
wetty.start(/* server settings, see Options */).then(() => {
|
|
|
|
console.log('server running');
|
|
|
|
/* code you want to execute */
|
|
|
|
});
|
|
|
|
```
|