typescript(translucid): fixed typos
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
6388e9cafb
commit
e3b8c17c56
|
@ -1,9 +1,9 @@
|
|||
# Translucid
|
||||
A simple node library to bind files to requests
|
||||
A simple node.js library to bind files to requests
|
||||
|
||||
# Get started:
|
||||
|
||||
First you need to insall the package:
|
||||
First you need to install the package:
|
||||
```
|
||||
npm install translucid --save
|
||||
```
|
||||
|
@ -13,26 +13,26 @@ Then, you need to include it in your project:
|
|||
const trans = require("translucid");
|
||||
```
|
||||
|
||||
To init your first server, call .QuickServer(port):
|
||||
To create your first server, call ".QuickServer(port)":
|
||||
```
|
||||
trans.QuickServer(8000);
|
||||
```
|
||||
|
||||
The .QuickServer methode return many useful objects:
|
||||
The ".QuickServer" method return many useful objects:
|
||||
```
|
||||
const {app,server,connect,translucid} = trans.QuickServer(8000);
|
||||
```
|
||||
Connect is a promise that resolves when the server starts listening to the port:
|
||||
"Connect" is a promise that resolves when the server starts listening to the port:
|
||||
```
|
||||
connect.then(() => {
|
||||
console.log("Listening on port 8000!");
|
||||
});
|
||||
```
|
||||
The translucid object can be used to make files bindings:
|
||||
The translucid object can be used to make file bindings:
|
||||
```
|
||||
translucid.bind("/","client/index.html",true//use midleware,["myId"]);
|
||||
```
|
||||
Then you can add midlewares like this:
|
||||
Then you can add midleware like this:
|
||||
```
|
||||
translucid.use({
|
||||
name:"my midleware",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"description": "A simple node library to bind files to requests",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "echo \"-1/12\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "github",
|
||||
|
|
Loading…
Reference in a new issue