In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What is the principle and usage of SpaceX-API developed by Nodejs? many novices are not very clear about it. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
What is SpaceX-API?
SpaceX-API is an open source REST API for rockets, core modules, space modules, launch pads and launch data.
Https://docs.spacexdata.com shows the provided API interfaces, as well as API calls in multiple languages. The right side of the following figure shows an example of Nodejs calls and the corresponding returned values.
What is the technology stack? Deployed on a Linode server in the central United States. Nodejs's Koa framework is used. Redis, Nginx and Cloudflare are used for content caching. Jest and Supertest are used for testing. Using Circle CI for continuous integration / deployment. All data is stored in the replica set cluster of the MongoDB Atlas 3 nodes. Use mongodump to back up your data at night, and check out https://backups.jakemeyer.sh/ here.
Koa is also a well-known framework in Nodejs, and some Node students asked before, are there any open source related projects to learn?
SpaceX-API project provides a lot of rich data, although it does not really allow you to build a rocket (does not include the real rocket production steps,), but it is possible to use the data to do some interesting projects, through open source projects is also a learning process.
The above figure shows the directory structure of SpaceX-API. You can see that koa, mongoose and ioredis are used. You can learn how they are used in the project by reading the original text at the end of the article.
How to deploy NPM Local deployment
Friends who are familiar with Nodejs, you can quickly deploy the project locally through NPM. If you have not installed Nodejs, you can refer to my article "3N Brothers" to help you complete the Node.js environment and set up NPM after the successful installation of NPM.
1. Clone into this warehouse.
$git clone https://github.com/r-spacex/SpaceX-API.git & & cd SpaceX-API
two。 Installation dependency
$npm install
3. Run ESlint and all the tests
$npm test
4. Open this app.
$npm start
Use Docker
In addition, you can also use Docker, the premise is to make sure that your Docker has been installed correctly, if you are not familiar with Docker, you can read this introduction to learn the basics of Docker introduction to practice
$git clone https://github.com/r-spacex/SpaceX-API.git & & cd SpaceX-API
$docker-compose build
Will docker-compose up be helpful to you after reading the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.