Z
Z
zotsuperplus2020-06-08 12:10:21
Software Deployment
zotsuperplus, 2020-06-08 12:10:21

How to host VK Mini Apps on a server?

Hello! Help deploy the VK MINI APPS template on the server. The purpose of this action:
I want to immediately develop on the server and see the result. In order not to suffer with the transfer of files back and forth. I hope for your understanding.

5ede00678ab3a505915896.png
I can't go to IP. just a white screen.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ostiwe, 2020-06-08
@zotsuperplus

You need a VPS and an ssl certificate
1) Create a folder on the server where the user cannot reach and create an application template there

npx @vkontakte/create-vk-mini-app /home/username/vkapp/project_name

2) After downloading the template, in the root folder of the project, create a folder where ssl certificates will be stored, for example "local-certificate". Next, we throw certificates with crt and key extensions there
3) In package.json in the scripts section, we slightly change the start command
....
"scripts": {
    "start": "cross-env PORT=5000 HTTPS=true SSL_CRT_FILE=./local-certificate/ssl.crt SSL_KEY_FILE=./local-certificate/ssl.key react-scripts start",
    "build": "react-scripts build",
    "predeploy": "npm run build",
    "deploy": "vk-miniapps-deploy"
  },
....

4) Run npm start
5) In the application settings (in VK) a domain with a port, for example https://domain.ltd:5000.
Don't forget to allow the specified port on the server.
Done, now it remains to connect to the server and start editing.
I recommend using phpStorm:
1) 5ede0d0491e39864921413.png
2) 5ede0d11c713c838762831.png
3) 5ede0d2024a3e498867056.png
4)5ede0d2b9232f631594585.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question