https://github.com/jcmdsbr/node-ts-basic-concepts
Learning node using typescript, express and mongo
https://github.com/jcmdsbr/node-ts-basic-concepts
body-parser express mongoose nodejs typescript
Last synced: about 2 months ago
JSON representation
Learning node using typescript, express and mongo
- Host: GitHub
- URL: https://github.com/jcmdsbr/node-ts-basic-concepts
- Owner: jcmdsbr
- Created: 2020-10-05T19:35:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T19:18:28.000Z (about 4 years ago)
- Last Synced: 2025-01-27T07:30:03.139Z (4 months ago)
- Topics: body-parser, express, mongoose, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Node basic concepts in ts using mongodb :sunglasses:
- Learning node using typescript, express and mongo
## Give a Star! :star:If you liked the project, please give a star ;)
## You need some of the fallowing tools :exclamation:
- Visual Studio Code
- Node 8+## Description :books:
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build
scalable network applications. In the following "hello world" example, many
connections can be handled concurrently. Upon each connection, the callback is
fired, but if there is no work to be done, Node.js will sleep.```javascript
class Startup {
app: express.Application;constructor() {
this.app = express();
this.configureServices();
this.configure();
}configureServices() {
MongoContext.createConnection();
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({ extended: false }));
}configure() {
this.app.route('/').get((req, res) => {
return res.send({ version: '0.0.1' });
});// news
this.app.route('/api/v1/news').get(NewsController.getAsync);
this.app.route('/api/v1/news/:id').get(NewsController.getByIdAsync);
this.app.route('/api/v1/news').post(NewsController.addAsync);
this.app.route('/api/v1/news/:id').put(NewsController.updateAsync);
this.app.route('/api/v1/news/:id').delete(NewsController.deleteAsync);
}
}
```
### Official Links :construction:- [child_process.fork](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)
- [cluster](https://nodejs.org/api/cluster.html)
- [Event Machine](https://github.com/eventmachine/eventmachine)
- [Twisted](https://twistedmatrix.com/trac/)