アプリ関連ニュース
- 2021年6月28日
- Web Service
A touch to serverless framework part 2
I talked about setting up IAM user and creating credentials on our computer. Today I will talk about creating our serverless project and start deploying to AWS cloud.
If you haven’t read part 1 , feel free to check it out here. So lets get started.
First lets build a folder, I will call it sls-api but you can name it whatever you want. Then lets go to our project , sls-api in my case and type this.
sls create --template aws-nodejs
This means we will create a node js project template for our serverless application. I told you we are going to use node js for this series in article1. After running this command , we will get an output.

We will have to update the code configuration before deploying. Open serverless.yml which is the core configuration file of our serverless project. We will add a stage and region to connect with our AWS like this

But be aware of the region of AWS. If the regions don’t match, the deployment will not work. Then Type sls deploy and wait for the result. This will start deploying our application to AWS cloud and create the necessary things.

As a result , our deployment will create a stack and lambda at AWS. As you see here, you have to know about AWS services a bit to understand these tutorial series because you are seeing stack and lambda etc. So If you don’t understand AWS, I recommend to read some articles about these services as we are focusing only on the serverless at the moment.
Firstly it will create a stack. A stack is a collection of AWS resources that you can manage as a single unit. In other words, you can create, update, or delete a collection of resources by creating, updating, or deleting stacks.Lets go and checkout on AWS stack console what the deployment build.

The name called sls-api is our project name and dev is the environment which we used to deploy our project. Furthermore, it will also create a lambda function. Lambda is a compute service that lets you run code without provisioning or managing servers. Lets go to Lambda console and you will get a function like this.

That is all for this week. I will talk about invoking our functions and creating endpoints in our project next week.
Yuuma
yuuma at 2021年06月28日 11:00:19
- 2021年6月25日
- 技術情報
Laravel 8 Push Notification using Firebase[2]
Here is final part how to do push notification using Firebase.Let’s start it.
Get Firebase Cloud Messaging (FCM) Server Key
This step will show how to get FCM key and Firebase web app’s configuration credentials.
Then firstly go to the Firebase site and we need to create a project.

Then add your notification app name for adding Firebase to web app.

Then copy the Firebase configuration keys, and this will help to connect laravel to Firebase.

Next, go to the project dashboard setting and copy the sever key and paste in HomeController of SERVER_API_KEY variable in sendNotification() function. Next step create the controller and let’s add the key.

Create Route
We need to do some of routes to store token and send push notification so let’s add our routes in web.php.
routes/web.php

Create Controller
Here, we need add saveToken() and sendNotification() method for admin route in HomeController.
app/Http/Controllers/HomeController.php


Then update the home.blade.php



In the final step, we have to create head over to a public folder and create a new firebase-messaging-sw.js file; this file holds the web push notification configurations.
public/firebase-messaging-sw.js

Finally, to see the push notification results we need to execute php artisan serve command. Next we will do register, signed-in and then click on the allow notification button, it will generate the device id, also add push notification title and body in the given form.
we will receive notification as like bellow:

By Ami
asahi at 2021年06月25日 10:00:20
- 2021年6月24日
- 他の話題
iPerf3を使用したネットワーク速度計測
nishida at 2021年06月24日 10:00:13
WindowsをAndroidタブレットから操作しよう
「安価なAndroidタブレットは便利だけど、
Windowsで使っているソフトがつかえたらな」
と思うことがたまにあります。
そこで便利なのが、AndroidからWindowsへリモートデスクトップ接続が行える
Remote Desktopです。
まず初めに接続先のWindowsでリモートデスクトップ接続を有効にします。
設定画面から「システム」->「リモートデスクトップ」へと進み
「リモートデスクトップを有効にする」をオンにします。

その後、必要に応じてリモートアクセス可能なユーザーを選択します。
次に、Android端末にインストールした Remote Desktop アプリを起動し、
「PCs」画面を開き、右上にある「+」ボタンをタップすると
自動的にネットワーク上にある接続可能なPCが表示されます。
ここに表示されていればソレを選択し、なければ、
「Add Manually」から接続対象のPCのipアドレスを指定します。
アクセスするユーザーのログイン情報を尋ねられるので、
ユーザー名とパスワードを入力し認証を完了します。
これで接続完了です。
このままでも使用できますが、
マウスでの操作をタップで行うのは難しいところがあるので、
リモートデスクトップ接続を解除し、
接続先のWindowsの設定を変更し、タブレットモードを有効にしましょう。
設定画面から 「システム」->「タブレット」へと進み、
「サインイン時の動作」を「常にタブレットモードを使用する」へ変更した後
再度 リモートデスクトップ接続 を行うことでタブレットモードで操作できます。
水曜担当:Tanaka
tanaka at 2021年06月23日 10:00:42
- 2021年6月21日
- Web Service
A touch to serverless framework part 1
A few weeks ago, I wrote an article about serverless and today I will make a touch to serverless framework using node.js and AWS (Amazon web service). This is just a simple and getting started article how to use serverless framework. I will be using mac OS for the operating system.
I will divided the parts because this article might be long as the article includes screenshots. So lets get started.
First, we need to check the node version in your computer. Check with node – v in your computer. Then we will install the serverless framework using npm.
sudo npm install -g serverless
We will get a result like this at the end of installation.

You can test whether serverless is installed on your computer or not using serverless or sls.

Ok , now we need to create IAM at Amazon console panel. Lets see the steps in below.
Here is the IAM dashboard.

Then we will create a new IAM user to integrate with our serverless project.

Add a username and mark the checkbox on programmatic access. Then go to next step for permission.

We will grant the user for administrator access for now as we want to build services from serverless configuration later on.

As a final step, we will get a new IAM user with access key and secret access key. We will use these keys to setup credentials in our serverless project. Lets create credentials as below
serverless config credentials --provider aws --key YOUR-ACCESS-KEY --secret YOUR-SECRET-ACCESS-KEY

This will be the correct response after hitting the above command and now we have successfully created credentials with IAM user.
In the next week, I will be talking about creating a project and start deploying from our serverless project.
Yuuma
yuuma at 2021年06月21日 11:32:52