This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
apps: [ | |
{ | |
name: "server", | |
script: "server.js", | |
instances: "max", | |
exec_mode: "cluster", | |
env_production: { | |
NODE_ENV: "production", | |
PORT: 5000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream nodejs { | |
ip_hash; | |
server localhost:5000; | |
server localhost:5001; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name SERVER_IP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream nodejs { | |
server localhost:5000; | |
server localhost:5001; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name SERVER_IP; | |
root /home/ryan; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
... | |
... | |
gzip on; | |
gzip_types text/plain application/xml application/json; | |
gzip_comp_level 9; | |
gzip_min_length 1000; | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream nodejs { | |
ip_hash; | |
server localhost:5000; | |
server localhost:5001; | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name DOMAIN_NAME; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name DOMAIN_NAME; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:dio/dio.dart'; | |
class ApiBaseHelper { | |
static final String url = 'BASE_URL'; | |
static BaseOptions opts = BaseOptions( | |
baseUrl: url, | |
responseType: ResponseType.json, | |
connectTimeout: 30000, | |
receiveTimeout: 30000, | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre-commit: | |
commands: | |
lint_code: | |
glob: '*.dart' | |
run: dart fix lib && git add . | |
format_code: | |
glob: '*.dart' | |
run: flutter format {staged_files} && git add . | |
pre-push: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: aws-step-functions | |
variablesResolutionMode: 20210326 | |
provider: | |
name: aws | |
stage: ${opt:stage, 'dev'} | |
# profile: profile-name | |
region: eu-west-1 | |
runtime: nodejs14.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
Future<dynamic> functionThatThrowsException() async { | |
// some code | |
throw Exception('Could not perform operation.'); | |
} | |
Future<void> testFunction() async { | |
try { | |
var x = await functionThatThrowsException(); |
OlderNewer