-
Notifications
You must be signed in to change notification settings - Fork 109
Overview
Thiago Bustamante edited this page Jan 20, 2019
·
1 revision
import * as express from "express";
import {Server, Path, GET, PathParam} from "typescript-rest";
@Path("/hello")
class HelloService {
@Path(":name")
@GET
sayHello( @PathParam('name') name: string): string {
return "Hello " + name;
}
}
let app: express.Application = express();
Server.buildServices(app);
app.listen(3000, function() {
console.log('Rest Server listening on port 3000!');
});
That's it. You can just call now:
GET http://localhost:3000/hello/joe
You can check this project to get started.
- Server
- @Path Decorator
- Http Methods
- Request Parameters
- Types and languages
- @BodyOptions Decorator
- Service Context
- Service Return
- @Security Decorator
- Express Middlewares
- @PreProcessor Decorator
- @PostProcessor Decorator
- Server Errors
- Service Factory and IoC
- Inheritance and Abstract Services
- Swagger Documentation