# Getting Started

## Installation

1. Install npm package\
   &#x20;`npm install odi --save`<br>
2. Install reflect-metadata \
   &#x20;`npm install reflect-metadata --save`<br>
3. Import reflect-metadata (for example in `index.ts`):\
   &#x20;`import "reflect-metadata";`<br>
4. Enabled the following settings in `tsconfig.json`<br>

   ```javascript
   "emitDecoratorMetadata":  true, 
   "experimentalDecorators":  true
   ```

## Hello World application

First of all, let's create simple controller `hello.controller.ts`

```typescript
import { Controller, IController, Get } from 'odi';

@Controller()
export class HelloController extends IController {

    @Get index() {
        return "Hello world !";
    }

}
```

And our startup file `index.ts`

```typescript
import "reflect-metadata";
import { Core } from "odi";

const port = 8080;
const sources = __dirname;

new Core({ server: { port }, sources }).listen();
```

Build your application and run it `tsc && node index.js` Check it in your browser

<div align="left"><img src="/files/-LPLPBRrHtOg1CwzfO6b" alt=""></div>

It was just a basic example. There are many other interesting things. Check docs for further information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://odi.gitbook.io/core/basics/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
