Skip to content

Commit

Permalink
commit by Serverless devs docs 12-5-2023 2:43:28
Browse files Browse the repository at this point in the history
  • Loading branch information
serverless-devs committed Dec 5, 2023
1 parent e449feb commit 6752deb
Show file tree
Hide file tree
Showing 6 changed files with 1,556 additions and 18 deletions.
108 changes: 99 additions & 9 deletions content/en/serverless-devs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,112 @@ category: 'Overview'

This quick start case takes [Alibaba Cloud Function Computing](https://github.com/devsapp/fc) as an example to quickly start with Serverless Devs(Of course, Serverless Devs also supports [AWS Lambda](https://github.com/devscomp/lambda), [Baidu Cloud Function Computing](https://github.com/xinwuyun/cfc), [Huawei Cloud Function Workflow](https://github.com/zy-linn/fgs-component) , [Tencent Cloud Function](https://github.com/devscomp/scf) and many other cloud vendors’ FaaS platforms. For details):
- [Tool installation](#Tool-installation)
- [Install via command line tool](#Install-via-command-line-tool)
- [Install by downloading the binary](#Install by downloading the binary) --- Suitable for all platforms (Windows/Mac/Linux)
- [Install via script](#Install-via-script)
- [Tool upgrade](#Tool-upgrade)
- [Key Configuration](#Key-Configuration)
- [Get started experience](#Get-started-experience)
- [Serverless: Hello World](#ServerlessHello-World)
- [AI: Target Detection](#AITarget-Detection)
- [Traditional framework: Django-based blog project](#Traditional-framework-based-on-django-blog-project)

## Tool installation
- Step 1: Install Node.js (>=12.0.0) and NPM package management tool;
- Step 2: Install Serverless Devs developer tools;
```shell script
$ npm install @serverless-devs/s3 -g
```
- Step 3: You can use `s -v` to judge whether the tool is installed successfully. If the installation is successful, you can see the corresponding version information, for example:
```shell script
@serverless-devs/s: 2.1.2, core: 0.1.41, s-home: /Users/xxx/.s, darwin-x64, node-v17.7.1
```
### Install via command line tool

Install via [npm](https://www.npmjs.com/) package management: applicable to Windows, Mac, and Linux platforms that have been pre-installed with npm. Execute the following commands on Windows, Mac, and Linux platforms to install Serverless Devs Tool.

```shell script
$ npm install @serverless-devs/s3 -g
```
Or install via [yarn](https://yarnpkg.com/)

```shell script
$ yarn global add @serverless-devs/s
```

> **illustrate**:
> - If you execute the command under Linux or macOS and report an error and the error message is `Command not found`, please execute the command `ln -s serverless-devs installation location /usr/bin`, serverless-devs installation location can be found by `find / -name s`.
> - If an error is reported when executing this command under Linux and the error message is `Error: EACCES: permission denied`, please execute the command `sudo npm install @serverless-devs/s3 -g`.
> - If you have a slow installation process in mainland, you can consider using Taobao npm source. The installation command is `npm --registry=https://registry.npm.taobao.org install @serverless-devs/s -g`.
### Install by downloading the binary
Open the [releases](https://github.com/Serverless-Devs/Serverless-Devs/releases) page, select a release compressed package link corresponding to the platform in the latest version, and click to download directly.

After downloading locally, unzip it and use it directly.

#### Windows Platform

1. Find a latest release version (Release) and download the `s-*-win.exe.zip` file (where * represents the version number, such as 2.1.9).
2. Unzip the file `s-*-win.exe.zip` to get `s-*.win.exe` file, rename it to `s.exe`.
3. Just copy the s.exe file to the system PATH directory, for example: `C:\WINDOWS\System32`
4. Open the command terminal, execute `s.exe --version`, and check the returned version number to verify whether the installation is successful.


#### Linux platform
1. Find a latest release version (Release) and download the `s-*-linux.zip` file (where * represents the version number, such as 2.1.9).
2. Extract the zip file
```
$ unzip s-linux.zip
Archive: s-2.1.9-linux.zip
inflating: s-2.1.9-linux
```
3. Move to PATH directory
```
$ mv s-*-linux /usr/local/bin/s
```

4. Verify version
```
$ s -v
@serverless-devs/s: 2.1.9
```


#### MacOS platform
1. Find the latest release version (Release) and download the `s-*-macos.zip` file (where * represents the version number, such as 2.1.9).
2. Extract the zip file
```
$ unzip s-macos.zip
Archive: s-2.1.9-macos.zip
inflating: s-2.1.9-macos
```

3. Move to PATH directory
```
$ mv s-*-macos /usr/local/bin/s
```

4. Verify version
```
$ s -v
@serverless-devs/s: 2.1.9
```

### Install via script

For Mac/Linux users

```shell script
$ curl -o- -L http://cli.so/install.sh | bash
```

## Tool upgrade

Serverless Devs developer tools will be updated and upgraded from time to time. When developers use Serverless Devs developer tools, they can be aware of the latest version according to system reminders.

After the client perceives the system upgrade, the developer can use the command `npm i -g @serverless-devs/s` to update, or use [Release](https://github.com/Serverless-Devs/Serverless-Devs/releases) View the specific content of the upgrade to determine whether to perform this upgrade.

> For example: My current Serverless Devs version is `2.0.89`. After the system is upgraded, I will use the Serverless Devs developer tool, and the tool will give a corresponding reminder:
> ```shell script
> ╭───────────────────────────────────────────────╮
> │ │
> │ Update available 2.0.89 → 2.0.90 │
> │ Run npm i -g @serverless-devs/s to update │
> │ │
> ╰───────────────────────────────────────────────╯
> ```
> At this point, just follow the reminder to update the tool.
## Key Configuration
Expand Down
Loading

0 comments on commit 6752deb

Please sign in to comment.