Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heismanish/course_selling_app-admin-dashboard

Admin side of a course selling app with a backend built entirely using Typescript.
https://github.com/heismanish/course_selling_app-admin-dashboard

full-stack mern-project typescript

Last synced: 30 days ago
JSON representation

Admin side of a course selling app with a backend built entirely using Typescript.

Awesome Lists containing this project

README

        

# Journey of JS to TS:

## In

1. Changing imports and exports from CJS to ES Modules.

2. Property 'authorization' does not exist on type 'Headers'.
=>

```typescript
import { Request, Response, NextFunction } from "express";
```

3. Property 'sendStatus' does not exist on type 'Response'.
=>
```typescript
import { Request, Response, NextFunction } from "express";
```

5. Property 'authorization' does not exist on type 'Headers'.
=>
```typescript
import { Request, Response, NextFunction } from "express";
```

6. Problem with id being a string `jwtAdminAuthentication`.
=>
```typescript
if (typeof user === "string") {
return res.sendStatus(403);
}
if (user) {
req.headers.user = user.id; // source
next();
}
```

## In `admin.ts`

1. "Property 'user' does not exist on type 'Request>'" in router.get("/me")