First Usage

Starting a server in Arcend is intentionally simple. A few lines are enough to spin up an API, load your routes, and begin handling requests without extra setup or hidden configuration. Just create a server instance, point it to your routes, and you're ready to go.

import { Server } from '@arcend/core';

const port: number = 4000;
const sv: Server   = new Server({port: port, cors: 'http://localhost:3000'});
sv.listen(async() => {
    await sv.loadRoutes('routes');
    console.log('API listening on: http://localhost:' + port);
});

Last updated