Giter Site home page Giter Site logo

wooodhead / shorten-urls Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serverless-plus/shorten-urls

0.0 1.0 0.0 44 KB

Serverless Shorten Urls Service

Home Page: https://url.sls.plus

License: MIT License

JavaScript 27.16% TypeScript 44.56% Pug 17.78% CSS 9.28% Shell 1.23%

shorten-urls's Introduction

Shorten Urls

Online

Build Status semantic-release

Serverless shorten urls service using serverless framework.

Features

Usage

$ git clone https://github.com/serverless-plus/shorten-urls.git

Development

Install dependencies:

$ npm install

To start server locally, you can start local posgresql by docker and connect to it for development.

Start local docker postgresql:

$ npm run docker:up

Then copy .env.example to .env:

$ cp .env.example .env

Run server:

$ npm run dev

Deployment

Before deployment, you should build project:

$ npm run build

Then you can deploy relative resources, after the first deployment, below step is optional for next time.

Deploy database

Serverless PostgreSQL need VPC, so we need create a VPC for it:

$ npm run deploy:vpc

Then we can deploy database:

$ npm run deploy:db

Deploy layer

For nodejs project, we can deploy node_modules directory to layer, so after first deployment, we do not need to deploy node_modules directory again, this is very useful to make our source code deployment quickly.

To make layer code smaller, we can run:

$ rm -rf node_modules && npm install --production

so we just deploy npm modules of production to layer,

$ npm run deploy:layer

Notice: after layer deployment, if you do not change npm modules for production, you don't need to deploy layer.

Deploy static files

Upload static files in public directory to COS:

$ npm run deploy:cos

Deploy server code

$ npm run deploy

Commit Lint

All git commit mesage must follow below syntax:

type(scope?): subject  #scope is optional

support type:

  • feat: add new feature
  • fix: fix bug or patch feature
  • ci: CI
  • chore: modify config, nothing to do with production code
  • docs: create or modifiy documents
  • refactor: refactor project
  • revert: revert
  • test: test

Most of time, we just use feat and fix.

License

MIT License

Copyright (c) 2020 Serverless Plus

shorten-urls's People

Contributors

yugasun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.