Meteor is a super simple environment for building modern web applications

Meteor is a super simple environment for building modern web applications

2022-12-22 0 1,335
Resource Number 50135 Last Updated 2025-02-21
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

The Meteor recommended in this issue is a full stack JavaScript platform for developing modern web and mobile applications

Meteor is a super simple environment for building modern web applications插图

Meteor is a full stack JavaScript platform used for developing modern web and mobile applications. Meteor includes a set of key technologies for building connected client reactive applications, a build tool, and a selection of packages from the Node.js and general JavaScript communities.

Meter characteristics

  • Meteor allows you to develop in one language JavaScript in all environments: application servers, web browsers, and mobile devices.
    Meteor uses data from the internet, which means the server sends the data instead of HTML, and then the client presents it.
    Meteor embraces the ecosystem and brings you the best parts of an extremely active JavaScript community in a cautious and thoughtful manner.
    Meteor provides full stack responsiveness, allowing your UI to seamlessly reflect the true state of the world with minimal development effort.

install

Prerequisite and useful information

  • If you are using Mac M1 (Arm64 version), you will need to install Rosetta 2 as Meteor uses it to run MongoDB. View how to install here
  • Meteor is suitable for Node.js versions>=10 and<=14. For Windows, you need to install Node.js to run the npm installer (note: you can use nvm to manage node versions).
  • Meteor supports Windows 7/Windows Server 2008 R2 and higher versions.
  • Disabling antivirus software (such as Windows Defender) will improve performance.
  • For compatibility, Linux binary files are built using CentOS 6.4 i386/amd64.
  • IOS development requires the latest Xcode.

Run one of the following commands from your terminal to install the latest official Meteor version.

For Linux and OS X:

curl https://install.meteor.com/ | sh

For Windows (requiring Node.js):

npm install -g meteor

Troubleshooting

If your user does not have permission to install global binary files and you need to use sudo, you need to append – unsafe perm after the above command:

sudo npm install -g meteor --unsafe-perm

We strongly oppose the use of Node.js or Meteor with root privileges. If you know what you are doing, please only use sudo to run the above command.

path management

By default, the Meteor installation program adds its installation path (~/. meteor/) to your PATH by updating your. bashrc,. bash_defile, or. zshrc as needed. To disable this behavior, run the following command to install Meteor:

npm install -g meteor --ignore-meteor-setup-exec-path

(or by setting environment variables
npm_config_ignore_meteor_setup_exec_path=true)

Old version on Apple M1

For Apple M1 computers, if you need to run an older version of Meteor (before 2.5.1), you can add the Rosetta prefix as follows:

arch -x86_64 npm install -g meteor

Or select Terminal in the Applications folder, press CMD (⌘)+I, and select the “Open using Rosetta” option.

Running Meteor in Docker

You can also use Docker containers to run Meteor in CI or even local development toolchains.
We do provide Docker images based on Meteor/Meteor base Ubuntu, which are compatible with Node JS and Meteor are pre bundled together and run as local users (rather than root).

Uninstall Meteor

If you use npm to install Meteor, you can remove it by running the following command: meteorological installer uninstall
If you install Meteor using curl, you can remove it by running the following command: rm – rf~/. meteor sudo rm/usr/local/bin/meteor

The documentation for Meteor’s password based account API.

The accounts password software package includes a complete password based authentication system. In addition to the basic username and password based login process, it also supports email based login, including address verification and password recovery email.
The Meteor server uses the bcrypt algorithm to store passwords. If the server’s database is compromised, this helps prevent embarrassing password leaks.
To add password support for your application, run the following command in the terminal:

meteor add accounts-password

On the client side, this function logs in as a newly created user after successful completion. On the server, it returns the newly created user ID.
On the client side, you must pass the password with at least one username or email – enough information so that the user can log in again later. If the username or email of an existing user only differs in case, creating User will fail. The callback error. reason will be ‘Username already exists.’ Or ‘Email already exists.’ In the latter case, users can log in or reset their password.
On the server, you do not need to specify a password, but users will not be able to log in until they obtain the password (for example, using the settings Accounts. setPassword). To create an account without a password on the server and still let the user choose his own password, createUser calls with the email option, and then calls
Accounts. sendEnrollmentEmail. This will send the user an email containing a link to set the initial password.

HTTP

HTTP provides HTTP request APIs on both the client and server. To use these features, please add HTTP packets to your project by running them in the terminal:
meteor add http
On the server, this function can run synchronously or asynchronously. If the callback is omitted, it will run synchronously and return the result after the request is successfully completed. If the request is unsuccessful, it will trigger an error. This is useful when making server to server HTTP API calls from the Meter method, as the method can determine the success or failure based on the results of synchronous HTTP calls. In this case, consider using this. unlock() to allow other methods on the same connection to run simultaneously.
On the client side, this function must be used asynchronously by passing callbacks. Please note that some browsers choose to send your request first (to determine CORS header) before sending it.
Supports HTTP and HTTPS protocols. The parameter must be an absolute URL, including the URL protocol and hostname on the server, but can be relative to the current host on the client. The query string URL replaced by this query option. The parameter params specified in the URL will be appended to any query string. For example, using urlof ‘/path? Query ‘and paramsos {foo:’bar’}, the final URL will be ‘/path’? query&foo=bar’。

Meteor.methods({
  checkTwitter(userId) {
    check(userId, String);
    this.unblock();

    try {
      const result = HTTP.call('GET', 'http://api.twitter.com/xyz', {
        params: { user: userId }
      });

      return true;
    } catch (e) {
      // Got a network error, timeout, or HTTP error in the 400 or 500 range.
      return false;
    }
  }
});

Example of asynchronous HTTP call:

HTTP.call('POST', 'http://api.twitter.com/xyz', {
  data: { some: 'json', stuff: 1 }
}, (error, result) => {
  if (!error) {
    Session.set('twizzled', true);
  }
});

Log recording

This logging package provides you with a standardized way to record and display various messages from applications in the console. An additional benefit is that it will show you the location of the trigger log and other data, which helps to quickly locate the source of the message during debugging.
Starting from the installation package:

meteor add logging

Then, you can import the utility from anywhere in the code as follows:

import { Log } from 'meteor/logging'

Then, you can call the logging function in one of the following ways:

Log('starting up') // or Log.info('starting up')
Log.error('error message')
Log.warn('warning')
Log.debug('this will show only in development')

In addition to passing in strings, you can also pass in objects. There are almost no exceptions and related special features. Firstly, the following keys are not allowed in the root directory of the object:

'time', 'timeInexact', 'level', 'file', 'line', 'program', 'originApp', 'satellite', 'stderr'

On the other hand, there are messages and apps that are also reserved, but they will be displayed in a more prominent way:

Log.info({message: 'warning', app: 'DESKTOP', error: { property1: 'foo', property2: 'bar', property3: { foo: 'bar' }} })

It will become:

E20200519-17:57:41.655(9) [DESKTOP] (main.js:36) warning {"error":{"property1":"foo","property2":"bar","property3":{"foo":"bar"}}}

The display of each log is color coded. The information is blue, the warning is magenta, debugging is green, and the error is red.

—END—

Open source license: MIT License

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code Meteor is a super simple environment for building modern web applications https://ictcoder.com/meteor-is-a-super-simple-environment-for-building-modern-web-applications/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services