Setup
Setting up your Sero development environment

We need to have the latest version of Node LTS installed. It can be downloaded here.
In a new terminal run mkdir sero-api and cd into it. Next run npm init to create a new project. Then install Sero.
Bash
PowerShell
npm i --save @sero.run/sero
npm i --save "@sero.run/sero"

Create a src directory and cd into it. Add an index.js file with the following contents:
index.js
import { Rest, Http, start } from "@sero.run/sero"
​
const config = {};
const http = Http(config);
​
Rest(config, http);
start(http);
In package.json, we're going to add a new script that runs the node server, and set the type to module. The file should now look like this:
package.json
{
"name": "cds-hooks-api-guide",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"@sero.run/sero": "^0.0.14"
},
"type": "module"
}
To run the server, run npm run start. You should now see this:
> node src/index.js
​
Sero booting at http://0.0.0.0:8080
Great job! We're ready for the next section, where we will be creating a CDS Service with Sero.
Copy link
On this page
Install Node + Sero
Basic setup