# 1. npm install

npm i sener
import { Sener } from 'sener';

new Sener({
   port: 9000,
   middlewares: [],
});

# 2. Install and use middleware

npm i sener-json sener-static sener-form sener-config sener-log sener-mysql sener-mongodb sener-rpc
// built-in middleware
import {
   Sener, Router, Cookie, Session,
   Cors, Env, IpMonitor, Validator
} from 'sener';
// standalone middleware
import { Json } from 'sener-json';
import { Static } from 'sener-static';
import { Form } from 'sener-form';
import { Config } from 'sener-config';
import { Log } from 'sener-log';
import { Mysql } from 'sener-mysql';
import { Mongo } from 'sener-mongodb';
import { RPC } from 'sener-rpc';

// ! For specific configuration, please refer to the corresponding document chapter
new Sener({
   port: 9000,
   middlewares: [
     new Router({}),
     new Cookie(),
     new Session(),
     new Json(),
     new Static(),
     new Form(),
     new Config(),
     new Log(),
     new Mysql(),
     new Mongo(),
     new RPC(),
   ],
});
Document update time: 5/29/2024, 12:08:46 AM