1.0.12 • Published 4 years ago
@bravejs/bootstrapper v1.0.12
BraveJS Bootstrapper
This is a simple package to bootstrap new BraveJS application.
Installation
npm i @bravejs/bootstrapper
Usage
Now you have to create a server.js
file in root, and .brave.json
, and .env
NOTE: You will need
nodemon
package to start theserver.js
file
In .env file.
HOST=127.0.0.1
PORT=3333
In your .brave.json file you should have something like that.
{
"name": "BraveJS",
"version": "1.0.0",
"providers": [
"@bravejs/env/build/providers/EnvServiceProvider"
],
"aliases": [],
"commandsProviders": []
}
Now let's head to our server.js
file
const { HttpServer } = require('.@bravejs/bootstrapper')
const httpServer = new HttpServer(__dirname)
httpServer.start((req, res) => {
console.log(req)
res.end()
});
Now you are ready, just try to access 127.0.0.1:3333